LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-20-2006, 12:49 PM   #1
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Rep: Reputation: 30
Exclamation conversion specifier for unsigned long in C


Hi,

I want to printf the value of an long unsigned int const, say var1,

is this the right way to do it?
Quote:
printf("var1=%u \n",var1)
What is the conversion specifier for unsigned long in C?

Thanks,
Ashlesha.

Last edited by ashlesha; 11-20-2006 at 12:53 PM.
 
Old 11-20-2006, 01:19 PM   #2
bit128_linux
Member
 
Registered: Dec 2005
Location: Brasov, Romania
Distribution: Slackware, Bluewhite64
Posts: 49

Rep: Reputation: 15
Code:
printf("var = %lu \n", var1);
'l' stands for long and 'u' stands for unsigned.
 
Old 11-20-2006, 01:20 PM   #3
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
Thank you v much!

-Ashlesha.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
printf unsigned long long int? blackzone Programming 9 03-04-2008 12:41 PM
invalid conversion from 'long unsigned int*' to 'uint32*' quarry_06 Programming 8 12-23-2005 11:00 AM
How to print unsigned long int alaios Programming 6 07-14-2005 10:27 AM
convert unsigned char * to unsigned long int linux_lover2005 Programming 3 04-26-2005 11:38 PM
What conversion specifier do I use for .... purpleburple Programming 12 09-03-2002 01:34 PM


All times are GMT -5. The time now is 05:36 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration