Thread: Types problem

  1. #16
    Registered User
    Join Date
    Apr 2010
    Posts
    24
    again crash but in second for loop !!!

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Post the EXACT FULL code, and what compiler are you using?

    Did you #include <string.h> ?
    Last edited by Adak; 07-23-2010 at 04:15 AM.

  3. #18
    Registered User
    Join Date
    Apr 2010
    Posts
    24
    I just copy/paste the code you gave me for tests

    http://img834.imageshack.us/img834/7935/21403503.png

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Dude! Get the updated version, as I mentioned previously. That's the old version.

    And if someone asks for code here, they mean C code unless specified otherwise. Not assembly code .

  5. #20
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    Code:
    void Prints(char **menu)
    {
       while(*menu)
       {
    
            printf("%s  ", *menu );
    
        }
    }
    
    char *arr[ ] = { "apple","orange","foo","bar", NULL };
    Prints(arr);
    You can either pass the number of strings(as suggested by laserlight), or end the array with NULL.

  6. #21
    Registered User
    Join Date
    Apr 2010
    Posts
    24
    TY to all of you I found my mistake it was in printf where i put %s instead of it i should placed %c !!!! ARGH!!!

    TNX AGAIN

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  3. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  4. Major Problem
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 02-19-2002, 01:06 PM
  5. having a problem with types
    By Donn1 in forum C Programming
    Replies: 8
    Last Post: 10-31-2001, 08:10 PM