Jump to content

C/C++ environment

- - - - -

  • Please log in to reply
14 replies to this topic

#1
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
Ok, so here is the deal. I'm going to start programming in C in the next course at the uni... and since Windows (which I'm using) doesn't have any compiler for C and I didn't like using cygwin to be able to use gcc at all, VM ware is slow and I don't like jumping between partitions if I actually install linux on my computer. Anyway to solve that problem and lay som groundwork in knowlege of C/C++ I've got myself a Visual Studio Professional 2010 (luckily as a computing engineer student I get it for free) but I'm really lost when it comes to compieling and runing... and be able to write C programs because I don't see anything for C there, only C++, C#, VB, SQL and some other stuff I don't yet get... so could anyone familiar with this pls help me get things started? prepherebly in C not C++

#2
artificial

artificial

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 624 posts

Roman Y said:

I've got myself a Visual Studio Professional 2010 (luckily as a computing engineer student I get it for free)

The Express Edition is free for everyone. ;)
Why don't you write your code in C and then compile it with MS's C++-compiler? I know that there are some differences, but basically it shouldn't matter.
If you want something like GCC, try MinGW. You can use it with IDEs like Code::Blocks or wxDev-C++.

Greets,
artificial
Sometimes words ain't enough to express something. That's why computer scientists use double words.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
minGW = GCC for Windows. Also, most C++ compilers also work as C compilers.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
Groogy

Groogy

    Programmer

  • Members
  • PipPipPipPip
  • 183 posts
C++ is supposed to have completely backwards compatibility to C. WinAPI for instance is written in C and do not as far as I know have any objects at all. But if Visual-C++ follows this too I don't know.

Anyway if you want to use GCC I recommend that you download and install Code::Blocks for windows with the included MinGW environment.
My Code Blog - My Github - Ascension Project - Madness Script Project - Simple-Garbage-Collector Project
There is bound to be something useful somewhere.

#5
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts

artificial said:

The Express Edition is free for everyone. ;)

well I've got professional edition cuz express wasn't even on the list (browsed at msdn e-academy) plus I figured, hey since it costs it should be somehow better...

and thanks for the tips and I'll try out this minGW to see what it is... I mainly created the thred to get help to figure out the VS environment.. I tryed the mdsn library but they gave me instructions of 2005 eddition and a lot of things were different...

#6
Groogy

Groogy

    Programmer

  • Members
  • PipPipPipPip
  • 183 posts

Roman Y said:

and thanks for the tips and I'll try out this minGW to see what it is... I mainly created the thred to get help to figure out the VS environment.. I tryed the mdsn library but they gave me instructions of 2005 eddition and a lot of things were different...

Well like I said. With Visual C++ you should be able to just write normal C code in it without having to worry that it is actually C++.
My Code Blog - My Github - Ascension Project - Madness Script Project - Simple-Garbage-Collector Project
There is bound to be something useful somewhere.

#7
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
Yeah I tryed that... I had trouble compieling... and runing it... for the first I tryet running build, and compile, I've got some lines below... but I didn't get any output what so ever... (should've been "Hello world") so what do I do once I've written the program and want to compile and run it?

#8
Groogy

Groogy

    Programmer

  • Members
  • PipPipPipPip
  • 183 posts
Can you show us the code and whatever error you got? Remember to put it in [ CODE ] brackets (minus the spaces)
My Code Blog - My Github - Ascension Project - Madness Script Project - Simple-Garbage-Collector Project
There is bound to be something useful somewhere.

#9
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
well the code was as simple as:

#include <stdio.h>


int main(int argc, char *argv[])

{

    printf("Hello World!");

    return 0;

}


So I don't think there was any error there... I just didn't find a way to compile and run it in VS environment...

#10
Groogy

Groogy

    Programmer

  • Members
  • PipPipPipPip
  • 183 posts
I think it's called Build in VS. So find something called Build & Run.
And you said something about not getting output? Might just be that you have to add a newline("\n") to the end of the string to printf()
My Code Blog - My Github - Ascension Project - Madness Script Project - Simple-Garbage-Collector Project
There is bound to be something useful somewhere.

#11
Roman Y

Roman Y

    Programmer

  • Members
  • PipPipPipPip
  • 189 posts
ok... finally figured out a bit of VS and could at least run a hello world... codes are basicly the same, but different libraries...

#12
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Be aware that that program is likely to run, blink a command window, end, and close the command window. The flickering window could be too brief to notice.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users