The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-19-2009
ajaysahoo ajaysahoo is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 14
segmentation fault in fwrite function

Hi,
my code is written in proC and it is in UNIX(AIX).I have written a small code for writing data into a binary file,but while writing my program is giving core dump.

Here Is my code----

fpWriteFile = fopen(WriteFileName,"wb+");


CHAR *recvgen;

recvgen = (char *)malloc(sizeof(char)*NSE_MAX_PACKET_RECV_SIZE);

fwrite (recvgen,NSE_MAX_PACKET_RECV_SIZE,1,fpWriteFile );