I am using getchar() while writing a program in C (scanf is not allowed yet at this point in the course.) I was wondering if every single time I call it if it moves to the next one; including during assignment operations. For example; I am trying to read in a double from the console; and decide if it has a negative sign on the front. If it does; I want to assign a variable neg to be 1 (so that I can tell if the end result should be returned negative) and then I want to move to the next character to do my actual double calculations and what not. ex)
int x = getchar();
int neg = 0;
if(x == '-') {
neg = 1;
x = getchar(); // will this make it so the next time I use the x
} // variable it will be past the negative sign and to the
//first actual digit?