943,869 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 8418
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 18th, 2007
0

Visual studio

Expand Post »
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
Last edited by amishosh; Jan 18th, 2007 at 7:21 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
amishosh is offline Offline
59 posts
since Oct 2006
Jan 18th, 2007
0

Re: Visual studio

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).
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 18th, 2007
0

Re: Visual studio

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jan 18th, 2007
1

Re: Visual studio

How to Compile C programs in Visual C++ 2005
http://cplus.about.com/od/learningc/qt/compilingc.htm
Last edited by Colin Mac; Jan 18th, 2007 at 2:24 pm.
Reputation Points: 78
Solved Threads: 22
Posting Whiz
Colin Mac is offline Offline
327 posts
since Sep 2006
Jan 18th, 2007
0

Re: Visual studio

Nice link Colin. I just tried it and it worked great.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 18th, 2007
0

Re: Visual studio

Click to Expand / Collapse  Quote originally posted by amishosh ...
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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 18th, 2007
0

Re: Visual studio

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Nov 1st, 2007
0

Re: Visual studio

hey guys when I put windows.h I get error saying
"cant find the file"


and I am sure we can use sleep function in place of delay
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rashid1990 is offline Offline
3 posts
since Oct 2007
Nov 1st, 2007
0

Re: Visual studio

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.

I am a beginner with microsoft visual studio and so I am lost
because I have always used turbo c++ and I am quite good at
it.

I want to use the delay function,but dont know how
I read somewhere that we can use sleep for that but for
that you need to include <windows.h> and whenever I try to do that
I get error saying file cannot be found


please help

rashid1990
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rashid1990 is offline Offline
3 posts
since Oct 2007
Nov 1st, 2007
0

Re: Visual studio

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.
Last edited by Ancient Dragon; Nov 1st, 2007 at 7:56 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Can this code be converted to TCL from C++ ..
Next Thread in C++ Forum Timeline: Just getting started in C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC