Hi all, I've got a little question about functions in c, I wrote a whole "program" (well, not so big, but still), which I am not going to post here, it's not important, instead I will try to explain my problem with a little example
assume you've got this:
now, in my program, the input is done by the user, character by character (it's on my psp)Code:int number = 4; //length of word string char word[number]; //declaration of word //later in the program, you specify the value f.e. //here comes input code for first char word[0] = 'f' //here comes input code for second char word[1] = 'o' //... word[2] = 'o' //... word[3] = '\0'
my question is, can I put the whole thing into a function, which first asks the user to input char by char, and then returns the whole string
the point is being able to put the function into a header file, so I can keep my code clean