2 simple questions for an expert ;)
Posted on 2003-03-10
Hi, I'm new to programming in C++ and I have to make a program for school. Almost everything works, but I still have one problem: When I'm reading a string that contains spaces using scanf, it reads 2 different strings. I know that you can make it 1 string with '' quotes, but how do I READ such a thing (using scanf)? scanf("%s",&tempnaam); is what i have now.
The second question is an easy one for you die hards i think :)
I have to make a function that can print messages with colours.
Something like this:
void melding(char message,color)
Then, I have to be able to call the function with a message and a color, like this:
melding("Data opgeslagen op schijf\n\nDruk op een toets om terug te keren naar het hoofdmenu",2);
That should print the message on screen in green.
I declared the funtion like this:
What am I doing wrong?
Thanks in advance!
PS, sorry for the amount of 10 points, but I'm new here and only have 75 points to spend ;)