User Profile

Collapse

Profile Sidebar

Collapse
yithape
yithape
Last Activity: Feb 25 '10, 10:40 AM
Joined: Jan 14 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • yithape
    started a topic Share Data between C & C++ Function
    in C

    Share Data between C & C++ Function

    // 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...
    See more | Go to post

  • 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 <<
    ...
    See more | Go to post

    Leave a comment:


  • 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. ...
    See more | Go to post

    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 !!
    See more | Go to post
No activity results to display
Show More
Working...