Thread: Does anyone know what this means

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    17

    Does anyone know what this means

    * list_of_strings add_to_list(list_of_strings *, char []);

    thats the line in the C++ code i got. i dont know what it is.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    I'm guessing this is a function prototype, but I don't think it's correct because it doesn't have a return type, just that its a pointer. As for the arguments, the first one is a pointer to a class/structure list_of_strings, meaning it passes a variable with the address of the real list_of_strings class. The second is a character array. It could be a string constant like: "Hello!" or a char array. Show more of the code and it would be easier to figure out what that means.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    I think u r right Crossbow. I think the programmer is trying to return a list_of_strings from the function and put the * in the wrong spot. However, I don't think that it is possible to return user defined types. If I am wrong, correct me because I am interested.

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    * list_of_strings add_to_list(list_of_strings *, char []);

    is nonsense. It probably should have been

    list_of_strings* add_to_list(list_of_strings *, char []);

    Which is a function prototype for a function called add_to_list which takes a list_of_string-pointer and a char array and returns the pointer.

    You can use user-defined types in return statements just like inbuild types.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What does this code means?
    By junkeat90 in forum C++ Programming
    Replies: 6
    Last Post: 01-14-2008, 05:03 AM
  2. can u help me wht this command means
    By cnu_sree in forum C Programming
    Replies: 2
    Last Post: 10-27-2007, 05:57 AM
  3. what does "close wait" and "fin_wait2" means?
    By hanhao in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-18-2005, 05:14 AM
  4. Can someone explain to me what this code means
    By Shadow12345 in forum C++ Programming
    Replies: 3
    Last Post: 12-22-2002, 12:36 PM
  5. Can someone explain what the EXP(X) function means?
    By raptor2xtreme in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2001, 12:19 AM