help about programming

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

Join Date: Sep 2003
Posts: 208
Reputation: camelNotation is an unknown quantity at this point 
Solved Threads: 2
camelNotation's Avatar
camelNotation camelNotation is offline Offline
Posting Whiz in Training

help about programming

 
0
  #1
Sep 14th, 2003
Hi.I have been learning c++ lately and I'm rather interested in learning to produce source codes and applications(games maybe).I need know that whether my choice about learning c++ for game programming is right or not.I'm not interested in web developement.I have read some of the posts in c++ forums and gained some knowledge. everybody is talking about IDE'S or Integrated Developing Environment but I think all langauges have IDE's except the old ones?
Like,I have a c++ compiler.I have been told that it's possible to link a text file written in notepad with my compiler and then run it.I have tried to open the text file from my c++ but it opens,I can't compile.Maybe you have noticed that,writing my codes in notepad is far easier than writing my codes in a c++ built-in text editor.If I need to delete one character I need to use mouse.If I use keyboard and hold the backspace key for three seconds,everything gets washed up! :evil: :mad:
BTW,would anyone please tell me the difference between a <iostream.h> and <iostream>?
Also,this is a different type of question for you.Please,give me some hints about creating a c++ application which will find ask the user to input his zodiac,output a paragraph about that zodiac in more than one lines.Do I need to use the "cin","cout",printing characters like \n or endl only?If you tell me the keywords that will of course help me.
Reply With Quote Quick reply to this message  
Join Date: Jul 2003
Posts: 117
Reputation: Iron_Cross is an unknown quantity at this point 
Solved Threads: 2
Iron_Cross's Avatar
Iron_Cross Iron_Cross is offline Offline
Junior Poster

Re: help about programming

 
0
  #2
Sep 29th, 2003
Why did you post this in the web dev forum?
Ok, using IDE's is very nice. And I think every language has at least one. C++ has a ton. Visual C++ is a very nice one, that I like to use. C++ is a good language for games, I know quite a few games coded in it. I guess it all depends on what type of games you're trying to create. Quake III was coded in C++ if I remember correctly.
<iostream.h> and <iostream> are the same thing. Just one is coded with the ANSI/ISO standard(the one without the .h) and the other is old style. Don't use the .h.
For your zodiac thing, cin and cout would be fine if you are wanting to create a simple command line type thing. Just use a switch statment:

  1. #include <iostream>
  2. #include <String>
  3. using namespace std;
  4. int main()
  5. {
  6. String zSign;
  7. cout << "Type your zodiac sign: "
  8. << endl;
  9. cin.getline();
  10. switch(zSign){
  11. case sign:
  12. cout << "blah stuff about blah sign...."
  13. << endl;
  14. break;
  15. case sign2:
  16. cout << "Blah stuff about blah sign 2..."
  17. << endl;
  18. break;
  19. default:
  20. cout<< "you must not have a sign"
  21. << endl;
  22. break;
  23. }
  24. return 0;
  25. }
the syntax may be off a little, it's been forever since I've used c++. But you should get the idea. The \n and endl are two different things. The \n prints a new line, you should place one wherever you want a new line to start. The endl clears out the out-buffer.
Hope this helped some
elitehackers.info
Today's Penny-Arcade!
Pain is weakness leaving the body!
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC