while(1){
AcceptSocket = accept(m_socket,NULL,NULL);
if(AcceptSocket != SOCKET_ERROR){
cout<<"New Connection."<<endl;
}
int iBytesRecv = SOCKET_ERROR;
char cRecvbuf[64] = "";
iBytesRecv = recv(AcceptSocket,cRecvbuf,64,0);
if(iBytesRecv > 0){
char cUsername[21];
char cPassword[18];
strcpy(cUsername,cRecvbuf);
strcpy(cPassword,&cRecvbuf[strlen(cRecvbuf)+1]);
cout<<"Login Requested. Username:"<<cUsername<<" Password:"<<cPassword<<endl;
int iStartTxt = strlen(cUsername) - 1;
cUsername[iStartTxt] = ".";
cUsername[iStartTxt + 1] = "t";
cUsername[iStartTxt + 2] = "x";
cUsername[iStartTxt + 3] = "t";
cout<<cUsername<<endl;
//ofstream a_file ();
}
}
--------------------Configuration: CTA_Login_Server - Win32 Debug--------------------
Compiling...
main.cpp
C:\Documents and Settings\Owner\Desktop\Lightning Round\CTA_Login_Server\main.cpp(83) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Owner\Desktop\Lightning Round\CTA_Login_Server\main.cpp(84) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Owner\Desktop\Lightning Round\CTA_Login_Server\main.cpp(85) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\Documents and Settings\Owner\Desktop\Lightning Round\CTA_Login_Server\main.cpp(86) : error C2440: '=' : cannot convert from 'char [2]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
CTA_Login_Server.exe - 4 error(s), 0 warning(s)