Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning arrays

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi there peoples,
Excited about Attack of the Clones??? Well I am!
Anyway, heres my problem....
I have accessor functions in a class that return int's to another class as those int's are private
eg:
int Node::getYear()
{
return year;
}

but i am also trying to return an array :
char Node::getDescription()
{
return data;
}
where data - char data[100];
and it gives me that annoying but common error:
"'return' : cannot convert from 'char [100]' to 'char'"
i know what the error means - but the problem is i dont know of another way to return an array .....
Can anyone please help me?? THNX for your time
 
Why don't you pass the array, or a pointer to the array, as a variable?
getDescription(char* description)
{
....
}
 
you can use this:

char *Fonction(void)
{
char data[];
....
......
return data;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top