On Mon, 2 Jun 2003, Raúl Gutiérrez Segalés wrote:
Hi,
I am trying to do a NOT operation but it doesnt seem to work well:
Sorry I meant 1's complement.
Actually I am still reading Jerry's function (getone()) and my trying to , breaking my head, understand this two assignations: newflags.c_cflag |= (CLOCAL | CREAD); newflags.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); The first one is very obvious since it is a simple oring which just adds the options but second one has an AND but first it does a 1's complement so I cant actually see the logic behind it.. Any one has mercy of this poor learner ?? :) Thanks once again, Raul
unsigned int i=8;
printf("%d \n", ~i);
This is suppose to print 247 but I get -9
Any ideas of what am I doing wrong ?
BTW, I am just practicing on playing with bits..
Thanks, Raul
-- To unsubscribe, email: suse-programming-e-unsubscribe@suse.com For additional commands, email: suse-programming-e-help@suse.com Archives can be found at: http://lists.suse.com/archive/suse-programming-e
-- To unsubscribe, email: suse-programming-e-unsubscribe@suse.com For additional commands, email: suse-programming-e-help@suse.com Archives can be found at: http://lists.suse.com/archive/suse-programming-e