Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

should be super easy to solve

Status
Not open for further replies.

hoggle

Programmer
Jul 13, 2001
124
US
I have a very simple question
I'm setting
int omode = O_WRONLY | O_CREAT | O_APPEND;

and I want to see what value it's given but...
printf(omode);

won't work
any ideas?
 
hi,
more than super easy.

The syntax of printf is

printf( string, ... ) ;

The first par may be a string as "ABC\n", and it prints and stop.

Alt. it can be a format string as

"%s" or
"%d% or
"%s %d"
"%s %s %d ......

In these cases, after the format string, you have to
follow variable to print

printf( "%d\n", omode ) ; or

printf( "The result is %d\n", omode ) ; or

printf( "%s %d\n", "The result is", omode ) ;

bye.


 
I thought it would be easy, I'm not a c programmer so...that will be my excuse for not knowing that

thanks for the quick reply :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top