Search:

Type: Posts; User: St. Jimmy

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    3,312

    malloc of char arrays

    A friend tells me that in C when u malloc a char array u have to allocate length of the string + 2 (1 for the '\0' and 1 cause C needs it for some reason, i forget why tho). Just windering if this is...
  2. Replies
    10
    Views
    1,958

    I just thought of this, so I'm not sure if it...

    I just thought of this, so I'm not sure if it will work but


    char *str, *tmp, *ptr;

    strcpy(str,"a string example");

    //lets remove the x in 'example' from this string
    //x is located at...
  3. Replies
    3
    Views
    1,162

    Figured it out

    if anyone is interested i got a solution to the problem. I take no credit for this, a friend and my dad were the brains behind it, but it makes sense if u think about it.

    the variable that i send...
  4. Replies
    3
    Views
    1,132

    I got rid of the initialization since the value...

    I got rid of the initialization since the value that is stored gets changed at the start of each function that need it. It worked to I don't get that warning.
    Thank you for your explaination.
  5. Replies
    3
    Views
    1,132

    i declare it extern int compflag =0; and there...

    i declare it
    extern int compflag =0; and there is no other declaration of it elsewhere.
  6. Replies
    3
    Views
    1,162

    hey, in another function that I call to get the...

    hey,
    in another function that I call to get the record i allocate the memory for the tags[][3] and i check and it works. I am not allowed to change the parameters for this function, If I could I...
  7. Replies
    3
    Views
    1,132

    Wierd warning?

    I get a warning when i declare a global integer variable extern?

    extern int compflag



    but when initialize a char variable extern from some old code i found I don't have the same warning....
  8. Replies
    3
    Views
    1,162

    flexible arrays of pointers

    Ok, so i have a function that has passed to it


    REC *(**recs)[].

    Which i see as a pointer to a pointer of an array of pointers :rolleyes:

    Where REC is a structure with

    struct REC{
Results 1 to 8 of 8