Visual studio
Hi!
Up until today I've been writing C with Borland C dos version. Only g-d knows why the school I go to teaches us C on that.
I want to start using MS's Visual Studio and I'm totally lost. It's a whole new enviornment of work. All their tutorials and help is only with C++ and I only know C.
I want to be able to first make a simple program with c that works. Where can I get help on this?
I have a question too:
I want to use functions like "delay" or "gotoxy". Eventhough I include the dos.h header file AND added it into my projects "Header files" the compiler still doesn't recognize those functions.
What am I doing wrong?
Thanks
Ami
amishosh
Junior Poster in Training
59 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
You will want to create a file with *.c extension and VC will compile it as a c file, not c++. Create a new empty project. Then add a new file, when you give it a file name also specify the *.c extension -- such as myfile.c. How you do all that depends on what version of VC you have. VC++ 6.0 is not the same as VC++ 2005 (the most recent version).
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
you're trying to create fullscreen DOS applications. AFAIK that's not supported by any reasonably modern compilers don't compile DOS programs anymore.
If they do, you may just need to pick the right target and possibly find the correct counterpart to Borland specific extensions to the standard C API.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Nice link Colin. I just tried it and it worked great.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I have a question too:
I want to use functions like "delay" or "gotoxy". Eventhough I include the dos.h header file AND added it into my projects "Header files" the compiler still doesn't recognize those functions.
What am I doing wrong?
Thanks
Ami
That's right -- VC++ 2005 Express and other 32-bit MS-Windows compilers do not support those header files. gotoxy() is not supported either, but Sleep(int milliseconds) found in windows.h can replace delay() from your old borland compiler.
win32 api has a whole set of console functions that allow you to move the cursor something like you did with gotoxy(). You might want to write your own gotoxy() that is a wrapper for those win32 api functions. See this MSDN entry. There are also a few tutorials on the net -- I don't have them available right now but I can look up the link in about 4 hours or so.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Here is the link I mentioned earlier. It contains some code you can download that demonstrates how to write console program using win32 api functions.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Exactly what version of the compiler are you using? VC++ 2005 Express ? If yes, then you need to download (free) the Windows Software Development Kit (SDK). See these google links for your operating system
And yes, the function you want is Sleep() . And BTW you might as well start right now getting accustomed to searching MSDN because you will need it alot.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
dev-cpp is only like 10mb and has windows.h with it.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439