Search:

Type: Posts; User: tlpog

Search: Search took 0.02 seconds.

  1. Replies
    18
    Views
    8,426

    whoops... i typed the example in haste and didn't...

    whoops... i typed the example in haste and didn't notice that... In the main program i use the malloc to allocate the memory so I can copy data from a file into different char arrays byte to byte.......
  2. Replies
    18
    Views
    8,426

    Indeed ItC... i think i was mixed up with the...

    Indeed ItC... i think i was mixed up with the notation show at the bottom of this fragment:


    char *a[2];
    char *b[2];
    char **all[2] = {a, b};
    a[0]= (char *)malloc(20);
    a[1]= (char...
  3. Replies
    18
    Views
    8,426

    Thank you salem and itC for the comments... I...

    Thank you salem and itC for the comments... I think I have enough info now to correct the problem. If i declare something like *a[3]; without initializing the variable with const data and later...
  4. Replies
    18
    Views
    8,426

    I screwed some based on your suggestions ItsC......

    I screwed some based on your suggestions ItsC...


    char *a[3] = {"AEI", "OUY", "JKL"};
    printf("OUTPUT 1: %c\n", *a[0]); //Accesses the letter A
    printf("OUTPUT 2: %c\n", *(a[0] + 1)); //...
  5. Replies
    18
    Views
    8,426

    If i understand your comment itCbitC, you are...

    If i understand your comment itCbitC, you are saying *(a + 0) + 1 adds 1 to ASCI of 'h', which of course returns a junk value. Maybe I need a clarification of what this decleration : char *a[3]; ......
  6. Replies
    18
    Views
    8,426

    thanks for the quick reply salem.. I definately...

    thanks for the quick reply salem.. I definately suspected something to do with memory allocation... guess it's time for me to learn something new :)
  7. Replies
    18
    Views
    8,426

    array of pointers/pointer arithmetic

    Long time troll, first time poster... I have some problems understanding arrays containing pointers. Take this fragment for example:


    char *a[3];
    char d[50] = {'a', 'b', 'c'};
    ...
Results 1 to 7 of 7