0

i am a beginner to the c language
recently i`ve come across the expression -
*s++ == *t++
what does this expression means??

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Narue
0

This is where you write a test program to find out for yourself:

#include <stdio.h>

int main ( void )
{
  const char *s = "test";
  const char *t = "temp";

  do
    printf ( "s: %c\tt: %c\n", *s, *t );
  while ( *s++ == *t++ );

  return 0;
}

*s and *t are compared, then s and t are incremented. If you break the expression down, it looks something like this:

*s == *t;
++s;
++t;

Edited by Narue: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.