0

What is the error in the function?

I have created a function that swaps the cases of english letters. when used directly, there is no error but there is error if it is used as a function. Why? https://code.sololearn.com/coVOcF7YOYzR/?ref=app

8th Sep 2022, 7:24 AM
Harsha S
Harsha S - avatar
3 Answers
+ 4
int lower(char a); int upper(char A); char to_upper(char c); char to_lower(char C); void swapCase(char str[]); define em at the top to make compiler happy :)
8th Sep 2022, 7:48 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 3
😁nope.. Thats how c world works.. you need to define your function before using it (although not necessarily ... but it saves you from getting these errs) .... or just change the order since lower() and upper() functions doesn't make use of any other functions you can move em at top... PS: Harsha S https://code.sololearn.com/cmnSg7F5Cyl8/?ref=app
8th Sep 2022, 7:54 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 2
Prashanth Kumar isn't there any other way because i want to be more happy than the compiler
8th Sep 2022, 7:50 AM
Harsha S
Harsha S - avatar