Visual studio

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 58
Reputation: amishosh is an unknown quantity at this point 
Solved Threads: 0
amishosh amishosh is offline Offline
Junior Poster in Training

Visual studio

 
0
  #1
Jan 18th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,468
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Visual studio

 
0
  #2
Jan 18th, 2007
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).
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Visual studio

 
0
  #3
Jan 18th, 2007
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 327
Reputation: Colin Mac is on a distinguished road 
Solved Threads: 22
Colin Mac Colin Mac is offline Offline
Posting Whiz

Re: Visual studio

 
1
  #4
Jan 18th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,468
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Visual studio

 
0
  #5
Jan 18th, 2007
Nice link Colin. I just tried it and it worked great.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,468
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Visual studio

 
0
  #6
Jan 18th, 2007
Originally Posted by amishosh View Post
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,468
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Visual studio

 
0
  #7
Jan 18th, 2007
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 3
Reputation: rashid1990 is an unknown quantity at this point 
Solved Threads: 0
rashid1990 rashid1990 is offline Offline
Newbie Poster

Re: Visual studio

 
0
  #8
Nov 1st, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 3
Reputation: rashid1990 is an unknown quantity at this point 
Solved Threads: 0
rashid1990 rashid1990 is offline Offline
Newbie Poster

Re: Visual studio

 
0
  #9
Nov 1st, 2007
Originally Posted by Ancient Dragon View Post
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,468
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1477
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Visual studio

 
0
  #10
Nov 1st, 2007
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC