I know that C program generally ends with return, where we return the status of the program. However, I want to return a string. The reason is that, I will be calling the C-executable from a shell script and printing the returned string. Is there any mechanism for the same ?
There is no such mechanism; the return code is expected to be a byte. If you want to output a string from your program then use something like printf()
and command substitution in the shell script to capture it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With