Thread: return value

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    11

    return value

    hi i'm not really expert in programming with c++, I don't if is possible but con i get a function to return a char array as the return value.

    thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >but con i get a function to return a char array as the return value.
    No. You can return a pointer to a char array, or a pointer to the first element of a char array, but not a char array itself. Most of the time, the answer to this question is to return a pointer to char. Just be sure not to return a pointer to an array declared in the function that returns it.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    11
    thanks i didn't think of that, that's why c++ is cool there's always a way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another weird error
    By rwmarsh in forum Game Programming
    Replies: 4
    Last Post: 09-24-2006, 10:00 PM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. opengl help
    By heat511 in forum Game Programming
    Replies: 4
    Last Post: 04-05-2004, 01:08 AM
  5. Algorithm to walk through a maze.
    By Nutshell in forum C Programming
    Replies: 30
    Last Post: 01-21-2002, 01:54 AM