This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem with my code...


Hi everybody..
This is the start of my code:

#include <iostream.h>
int main ()
{
int number;
char adjcoffee;
char adjdog;
char adjcat;
char adjmouse;
char adjocean;
cout << "\nChoose a number between 1 and 100:";
cin >> number;
cout << "\nGive an adjective for dog:";
cin >> adjdog;

Well, first i tried to declarate all the char, separated with "," but the
compiler warned about undeclared variables. Then, i do this way. The
problem is: When i put an adjective for dog, it jump a piece of my code.
Like this:
Choose a number between 1 and 100: 3
Give an adjective for dog: Ugly
-> this line stay empty
cat: -> dont ask for the adjective
Mouse: -> The same
Coffee: -> Hidden
Ocean: -> Ask normally

But if i put numbers, it works normally, like if i had declared a int.

What i am doing wrong???
Thanks... Oh, and one comment... Java is much easier than this...:)))



-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Home Page: http://i.am/marshall/
e-mail: marshall@cwb.matrix.com.br ou marshall@i.am

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]