hi , I got a little problem , i want the user in my chat programm to be able to type his name , then be able to chat , and chat , till he drops , i tyed to do that with a loop , but its looping the username with it , does the username needs to be in an other loop for this ?cause now it goes like : <username> says : h <username> says i . instead of <username> says : hi
ok here it is :
thanks.Code:#include <iostream> using namespace std ; #include <stdlib.h> #pragma hdrstop int main ( int , char** ) { unsigned char x = 4 ; char pname[64] ; unsigned char z = 0 ; unsigned char a = 2; char says[64] ; cout << endl << "username: " ; if ( pname != 0 ) { gets(pname); while ( a != 0 ) { cin >> z ; cout << pname << " says : " << z ; } cin.ignore(); return 0 ; } }