LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-22-2006, 12:22 PM   #1
manomohan
Member
 
Registered: Jul 2005
Location: india
Distribution: Fedora core 3
Posts: 42

Rep: Reputation: 15
what is %0qx


key_t temp;

temp = ftok("ftok_test.c", 'a');
printf("id 2 temp = %0qx\n",temp);

Here in the above code what is " %0qx "
 
Old 03-22-2006, 12:34 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Its the format string, explaining how the variable temp will be displayed.

% signifies the start of a format string
0 means pad with a zero
q probably a typo - it doesn't have any special meaning that I can think of. had it been a 2 then this would say the number of characters to be printed out
x this is the conversion and says display the value as a hexadecimal number
 
Old 03-22-2006, 04:54 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
'q' is an alias for 'll', which means "long long integer".
You can read all about this in "man 3 printf".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration