Search:

Type: Posts; User: david.jones

Search: Search took 0.01 seconds.

  1. Well temp is just a regular char array i.e. char...

    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).
  2. How to read a line and store it into an array?

    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...
  3. How to multiply number elements in a string?

    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...
  4. Replies
    4
    Views
    5,612

    How to calculate the average of scores?

    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:...
  5. Replies
    16
    Views
    2,850

    I figured it out guys. There was an extra break...

    I figured it out guys. There was an extra break line in my .txt file and hence the segmentation error.
  6. Replies
    16
    Views
    2,850

    nevermind

    nevermind
  7. Replies
    16
    Views
    2,850

    sorry about that. I was playing around with code...

    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.
  8. Replies
    16
    Views
    2,850

    This is the line that gets printed before the...

    This is the line that gets printed before the crash anduril:

    RES001;CUS001;R101;1;05/06/2011;08/06/2011;reserved
    Segmentation fault
  9. Replies
    16
    Views
    2,850

    @CommonTater THe length of the reservationId...

    @CommonTater

    THe length of the reservationId is 6 characters hence why I put 7.
  10. Replies
    16
    Views
    2,850

    Ha! Sorry about that. Although I'm still getting...

    Ha! Sorry about that. Although I'm still getting the segmentation error.
  11. Replies
    16
    Views
    2,850

    The segmentation error occurs here: item =...

    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.
  12. Replies
    16
    Views
    2,850

    Segmentation Error

    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
Results 1 to 12 of 21