i keep experiencing this particular error while doing pointer arithmetics in C/
e.g
Code:
#include <stdio.h>
int strcmp(char *s, char *t);
int main(){
char s[] = "hello";
printf("%c", *++s);
}
the error is
C:\Users\xx\Documents\strcmp.c|9|error: lvalue required as increment operand|
but when i changed *++s to *(s+1); it runs and outputs the character 'e'.
are they not essentially the same? as far as i know this works when used for parsing commandline arguments using switch but for an unknown reason barely works normally