returning a char table (C)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Transmit
    New Member
    • Dec 2006
    • 11

    #1

    returning a char table (C)

    What kind of function would I need to have to return a table that contains a string.

    example:
    int filltable(param eter){
    char table[20] = {0};

    return table[]
    }
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Your return type could be string, but you would have to use the string class to build it instead of a character array. Otherwise, you can return a char pointer to the first element in your array. I'm pretty sure you can't return an actual array in C++.

    Comment

    Working...