// This is My Client TCP program in C++
// Program Name client.cpp
#include <winsock2.h>
#include <iostream.h>
#include <windows.h>
#include <iomanip>
char szServerIPAddr[ 20 ] = "192.168.5. 251" ; // IP address of my Server
int nServerPort = 5000 ; // The server port that will be used by clients for communication
int...
User Profile
Collapse
-
Share Data between C & C++ Function
-
...Code:// This is the Send function for sending the querry while ( ( nCntSend = send( hClientSocket, szBuffer, nLength, 0 ) != nLength ) ) { if ( nCntSend == -1 ) { cout << "\n Error sending the data to server" << endl ; break ; } if ( nCntSend == nLength ) break ; //pBuffer += nCntSend ; cout << -
None of above is happening:
1} deallocating the array too early :: Not possible --> as i wait for "recv" function to execute completely to grab all data bytes received from server in my TCP program. And then i assign the [char *] .So eventually the second possible of assigning wrong Pointer is also void. It can not be possible. However i honestly feel i must get the actual progrm & then u can suggest me the exact issue. ...Leave a comment:
-
How to [share/ transfer] an array [char/int] between C & C++ programs !!
Hello ,
I have two differnt functions in C & in C++ . I want my variable in C++ program which is an array of characters & Integer if possible to be send to my c program. I tried using pointer but the moment control comes out of my C++ i loose all data in that array or i get garbage variables.
Can anyone please guide me for this issue. It will be really great !!
No activity results to display
Show More
Leave a comment: