Thread: Help with Arrays

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    33

    Help with Arrays

    Code:
    I am tryin to store strings in an array "aqq" but when i copy to **ar and print it only prints the last element... lets strings are :
    
    we
    you
    it
    not 
     
    only prints "not" 4 times
    
       while(fgets(c,sizeof(c),fq)!=NULL)
       {
        printf("%s",c);
        aqq[count]=c;
        count++;
       }
       char **ar=aqq;
       while(*ro){
        printf("new %s",*ro);
        ro++;
       }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Why is it so hard for you to figure out that code tags go around just the code?
    Not to mention asking the same basic question over and over in a succession of new threads (reply to an existing one).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    33
    okay!! i got it!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM