I have a void function which take the string from a global variable and prints them.
The problem is that the void function prints a message/does stuff even if the string is empy. so if the global variable is empt it just prints "message is:" i only want to do something if the string has characters.
what i want to do is to check if the string is not empty, then print a message.
// global variable
char msg[30];
scanf("%s", &msg);
void timer(void) {
//i want to only print if there is a message
printf("message: %s", msg);
}
thanks for any help