Is there anything that can be done to change C++ text into different colors or fonts and can you change the backround from black to somthing else? thank you in advanced
Is there anything that can be done to change C++ text into different colors or fonts and can you change the backround from black to somthing else? thank you in advanced
C++ is me favorite!
thank you and I got a problem with this
Im trying to make it read a random number but a get alot of errors. Any suggestions?Code:#include <iostream> #include <cmath> using namespace std; int main() { int randmon[1] = 1000; int randmon[2] = 2000; int randmon[3] = 3000; int randmon[4] = 4000; if (randmon == 1000) { cout<<"Hello"; cin.get(); if (randmon == 2000) { cout<<"What?"; cin.get(); if (randmon == 3000) { cout<<"Maybe?!"; cin.get(); if (randmon == 4000) { cout<<"No or yes which one?"; cin.get(); } } } } }
C++ is me favorite!
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Code:#include <iostream> #include <cmath> using namespace std; int main() { int randmon[5] = {0, 1000, 2000, 3000, 4000}; //I don't get what you're trying to do from this point on if (randmon == 1000) { cout<<"Hello"; cin.get(); if (randmon == 2000) { cout<<"What?"; cin.get(); if (randmon == 3000) { cout<<"Maybe?!"; cin.get(); if (randmon == 4000) { cout<<"No or yes which one?"; cin.get(); } } } } }
Thank you and to you above umm I was just playing around
also thanx dave
C++ is me favorite!
thank you, i still don't know how to compile a code on codeblock though...
but now I get an error saying
ISO C++ forbids comparrision between pointer and integer
C++ is me favorite!
> ISO C++ forbids comparrision between pointer and integer
Good for you.
Wanna post some code to go with that?
the code is up there
C++ is me favorite!
You are trying to compare randmon (the starting address of an array) to an integer.
randmon[i] represents an individual element of the array
And you're declaring randmon multiple times. And you can't initialize it like that (it's an array).
Try rand() and srand() (<cstdio>), and time() (<ctime>).Im trying to make it read a random number but a get alot of errors.
(Sorry, Prelude.)Code:#include <iostream> #include <cstdio> #include <ctime> int main(void) { srand(time(0)); std::cout << "A random number between 0 and 9: " << rand() % 10 << std::endl; return 0; }
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.