Well temp is just a regular char array i.e. char temp[20] in order to store the string which will then be copied to the structure array called record (which includes the arrays name and phone number).
Type: Posts; User: david.jones
Well temp is just a regular char array i.e. char temp[20] in order to store the string which will then be copied to the structure array called record (which includes the arrays name and phone number).
Hi,
I was just wondering if anyone can help me with this problem? For some reason it won't allow me to store the input from the user into a single element of the array for example:
> Please...
Hi guys well I have this problem, for some reason I'm not quite sure how to multiply an integer to each indicual element in a string.,
Here's my code:
for (counter = 0 ; counter...
Hey guys, for some reason I can't figure out how to calculate the average from a number of scores in an array.
I've tried although I get weird numbers e.g 1003434343.43 or inf. Here's my attempt:...
I figured it out guys. There was an extra break line in my .txt file and hence the segmentation error.
nevermind
sorry about that. I was playing around with code while waiting for a response so I copied the bit I modified.
However i still receive a segmentation error.
This is the line that gets printed before the crash anduril:
RES001;CUS001;R101;1;05/06/2011;08/06/2011;reserved
Segmentation fault
@CommonTater
THe length of the reservationId is 6 characters hence why I put 7.
Ha! Sorry about that. Although I'm still getting the segmentation error.
The segmentation error occurs here:
item = strtok(line," ");
strcpy(record[reccount].reservationId,item);
and the only line that outputs in the loop is the first printf.
For some reason I keep on getting a segmentation error when trying to run the code.
Does anyone know how I can fix it?:
#include <stdio.h>
#include <string.h>
#define MAXLEN 120