Basic C++ Problems
I'm having basic C++ problems. What's the problem? I'll do a direct copy+paste from Command Prompt.
Code:
Hello, please input your username: Code:
#include <iostream.h> |
int -> integer, this is a number, not a char string.
name will never contain 'Test'. After than check the if syntax :) |
Soo.... what do I use instead of int?
|
char name[12];
for example if (cat==1) { } instead of if (cat==1) then |
Revised:
Code:
#include <iostream.h> |
keep cat as an int if you make your tests like that " if (cat==1) "
1 is an int '1' is a char |
Muuss is right.
You made cat a type char so the compare should be: Code:
if (cat=='1') |
How to read a string properly in C++.
Code:
#include <iostream> |
All times are GMT -4. The time now is 06:28 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.