Hello,
I have just recently began studying C programming. I use books (Im not yet in University) and its going great so far!
I ran into a problem with one of my programs.
Im trying to assign a string to an array. But not just any string but a string that is returned by a function.
What I tried was:
This is of course just the required areas. I did not include all the variables, statements, etc. The whole program is a bit too big so I didn't want to encumber you. But the code is where the mistake is, so please help me.Code:/* The Function */ char change_left_side(int x); /* Array */ char left_digit[10]; /* Start */ int main() { left_digit = change_left_side(entered_number); } /* The actual function code */ char change_left_side(int x) { return("Hello!"); }
What is the best way to return a string and assign that returned string to an array?
Thank you,