title: How to check if String is empty in C
body: <p>I have a void function which take the string from a global variable and prints them.</p>
  
  <p>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.</p>
  
  <p>what i want to do is to check if the string is not empty, then print a message.</p>
  
  <pre><code>// global variable
  
  char msg[30];
  scanf("%s", &amp;msg);
  
  void timer(void) {
      //i want to only print if there is a message
      printf("message: %s", msg);
  }
  </code></pre>
  
  <p>thanks for any help</p>