segmentation error
Hi
I am using solaris machine in which I use gcc compile. I am getting segmentation error in the following statement fprintf(stream_pointer_name, "\t%c16%c16%c16%c16%c", '|','|','|','|','|'); I am trying to print '|' five times in a file at a 16 spacing gap. Can any one tell me the reason? |
Not sure....whenever I get a segmentation error, it is normally because I am trying to access a memory location which does not exist.
|
The segmentation violation is more likely due to something wrong with your stream pointer. There is also a problem with your output format.
Here is something that match your requirements: Code:
fprintf(fp, "\t%16c%16c%16c%16c%16c", '|','|','|','|','|'); |
Hi
I got the reason for segmentation error(fault). Actually I was declaring a pointer n by mistake I was not allocating the space for that pointer before use |
All times are GMT -5. The time now is 10:15 PM. |