im kinda new with these
to cut to the chase basically im making a game, interactive fiction to be exact.
for example:
1 2 3 4 5 6
|
char choice[5];
if (choice == "START")
{
cout<<"blah blah blah";
}
|
but i can't seem to make it work
it's showing nothing
but this works
1 2 3 4 5 6
|
char choice;
if (choice == 'Y')
{
cout<<"blah blah blah";
}
|
i don't get it
and can i ask how to sort of delay the outputs?
for example:
*knock* (1 sec. delay)
*knock* (1 sec. delay)
*knock* (1 sec. delay)
*knock* (1 sec. delay)
Last edited on
Neither C nor C++ supports comparison of two character arrays. If you're going to use C style strings, you have to use the strcmp library function.
Change choice to type std::string and your comparison will work as coded.
i don't know what strcmp but im studying it now thanks
can you help about my second problem too?
output should be like this:
*knock*
(1 second delay)
*knock*
(1 second delay)
*knock*