- Upvotes Received
- 11
- Posts with Upvotes
- 7
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
18 Posted Topics
Re: i have my first game code of a dice game you can look at if you would like. ill post it if you reply back, it displays the dice using characters... its simple but i like it. | |
Re: there is a really helpful library called <algorithm> that can help you with string manipulation and comparing etc. look it up online or a book or something... good luck | |
Re: thats easy... #include <iostream> #include <cstdlib> using namespace std; int main() { int x = 0; while (x < 101) { cout << x << endl; x = x + 2; } system("pause"); return 0; } | |
Re: make a game that uses dice. you roll 2 dice and you are rolling against the computers 2 dice. make the dice random and whoever has the bigger sum wins or gets 1 point... i dunno, start with that and build up from there, if you are just starting all … | |
Re: A header file is made up of pre-processor directives, classes, namespaces etc. a good place to look at is [url="http://www.cplusplus.com/doc/tutorial"]cplusplus.com[/url]. look at the classes, objects and namespaces chapters... | |
hey... im in a c++ class at school but i also program at home. my teacher refuses to teach me graphics and i wanted to know if there was an easy way to just basically cout a graphic. if this is noobish and i need to learn a lot more … | |
Re: yea... it's very useful... here's the code: #include <iostream> #include <windows.h> #include <cstdlib> using namespace std; [CODE] int main() { cout << "Hello..."; Sleep(2000); cout << "World..."; cin.get(); return 0; }//end main function [/CODE] if you do not have the windows.h header for some odd reason unknown to me, which … | |
i dont know why im asking this... im just curious. I have dev-cpp compiler and i was experimenting with header files and reading them expanding my knowledge... and im just wondering what the difference between a c header file and an h header file is... they seem to be doing … | |
Re: could you give an example of code... i dont know what you mean by this SAFEARRAY thing... it sounds interesting... be smart kids and practice your SAFE HEX... :p | |
Re: actually, if i was paying attention in class, i believe it's the other way around. logical operators such as || (or) && (and) etc. come before mathamatical operators, <= (less than or equal to) != (not equal to) etc. I'm sure that will compile just fine without it. but this … | |
Re: could you give us an example of code that when you press the up arrow it says up, then ends the line and the same for the other three arrows? i just want to see an example really... thanx | |
Re: i hate making decisions for people but in my opinion do c++... its good... so just do it... | |
Re: ok... visual c++ is exactly the same as any other compiler except its a lot easier to use because it has many things built into it... anything in visual c++ can be done in any other version... | |
Re: if its just in the dos screen #include <iostream> #include <cstdlib> using namespace std; int main() { cout << "Hello World!" << endl; [color=red]system("cls");[/color] [color=black]cout << "End of program";[/color] [color=black]system("pause");[/color] [color=black]return 0;[/color] [color=black]}[/color] you can put any dos command in the quotes... but make sure you include cstdlib | |
Re: well... maybe you haven't read enough... you should start with the simplest program in c++, the "Hello World!" program. you must first #include any header files you need for the specific program, usually <iostream> is used for inputing and outputing. then you must make your int main() function, this is … | |
how do u pause a command in c++? i know how to pause using system("pause") or cin.get() but i want to know hot to make the program sleep for a certain ammount of time... like vbs' wscript.sleep 1000... if that helps thanx | |
Re: [url="http://www.cplusplus.com"]www.cplusplus.com[/url] but nothing is better than a book. SAMS teach yourself c++ in 24 hours is awesome. but go through the lessons really slow. also, nothing compares to a class when learning a language... staring at code wont help you because even if you know a command like "cout" you … | |
Re: the random number generator (srand) usually uses time as its string. the time(NULL) is held in the ctime.h library and it takes i think the ammount of seconds from some date in the 70's and does an equation with it. the number isnt completely random but it does a good … |
The End.