title: How to pass a character pointer to a function
body: <p>I am trying to solve a problem in which I have to take a character pointer and store an email and then  pass that pointer to a function so that I can verify if there are any special characters in the input string.
  Here is the code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void verify(char** em)
  {
      char *z = *em;
  
      while(*z)
      {
          printf("%c", *z++);  
      }
  
      while(*z != '\n')
      {
          if(*z == 'a')
          {
              printf("present");
              *z++;
          }
          else
          {
              printf("not present");
          }
      }
  }
  
  int main()
  {
      int count = 0;
      char *email = malloc(sizeof(char) * 100);
  
      printf("enter the email id\n");
      scanf("%100s", email);
  
      while(*email)
      {
          printf("%c", *email++);  
      }
  
      verify(&amp;email);
      return 0;
  }
  </code></pre>
  
  <p>Whenever I pass the character pointer to my function verify() and try to print the string, I don't get the required output.</p>
  
  <p>how can i use this function to verify if any input email is valid or not?
  i am trying to find the index of '@' and check for characters before @ and after @,but i don't know how can i store the index of '@' because it is not an array.  </p>