Sponsored Content
Full Discussion: please help with C
Top Forums Programming please help with C Post 302494123 by ra2000 on Saturday 5th of February 2011 10:48:30 AM
Old 02-05-2011
please help with C

I have a C test next week,so someone please help me in understanding the output of following 2 codes

1.
Code:
#define T t 
void main() 
{ 
char T = `T`; 
printf("
%c %c
",T,t); 
}

the output is T T, but since a macro is defined, i thought it would be t t


2.
Code:
void main() 
{ 
int a=0; 
int b=0; 
++a == 0 || ++b == 11; 
printf("
%d,%d",a,b); 
}

the output is 1 1 but the condition is false, so why this output?

Last edited by Scott; 02-05-2011 at 12:15 PM.. Reason: Please use code tags
 
cfspeed(3C)															       cfspeed(3C)

NAME
cfgetospeed(), cfsetospeed(), cfgetispeed(), cfsetispeed() - tty baud rate functions SYNOPSIS
DESCRIPTION
These functions set and get the input and output speed codes in the termios structure referenced by termios_p. The termios structure con- tains these speed codes representing input and output baud rates as well as other terminal related parameters. Setting the parameters on a terminal file does not become effective until is successfully called. returns the output speed code from the termios structure referenced by termios_p. sets the output speed code in the termios structure referenced by termios_p to speed. The speed code for a baud rate of zero, is used to termi- nate the connection. If is specified, the modem control lines are no longer asserted, which normally discon- nects the line. returns the input speed code from the termios structure referenced by termios_p. sets the input speed code in the termios structure referenced by termios_p to speed. RETURN VALUE
returns the output speed code from the termios structure referenced by termios_p. returns the input speed code from the termios structure referenced by termios_p. and return zero upon successful completion. Otherwise, they return -1 and set to indicate the error. ERRORS
and fail when the following condition is encountered: [EINVAL] The value of speed is outside the range of possible speed codes as specified in WARNINGS
and can be used to set speed codes in the termios structure that are not supported by the terminal hardware. SEE ALSO
tcattribute(3C), thread_safety(5), termio(7). STANDARDS CONFORMANCE
cfspeed(3C)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy