Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-25-2014, 05:04 PM   #1
LQ Newbie
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Question printf

I am learning C from Deitel C How to Program C, 6th Edition. There are things that go forward without explanation, or maybe I just missed it when I stepped out for fresh air, blinked, whatever.
In fig 6.3, line 20 what does printf ("%7d%13d\n",i,[I]); , or
The previous line 16
printf("%s%13s\n", "Element", "Value", although this one is easier to understand, because you can see the print out below it on p.166, it is still ambiguous to someone that is new.
What would work for me is to have someone go over ea. line word for word , statement for statement, function by function, loop for loop, explain every step of the way in a human language, preferably English.
Old 05-25-2014, 05:46 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,903

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
printf ("%7d%13d\n",i,[I])
print the integer elements of a array with a 7 char and 13 char field
with a newline feed.

printf("%s%13s\n", "Element", "Value"
print the string elements of a array, with a newline feed.
Old 05-26-2014, 04:49 AM   #3
LQ Newbie
Registered: Feb 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks, for the quick response. I wish I had someone to walk me through this, every function, argument, loop, recursion, iteration, etc., translate it all into English, you know read the code to English, that would be awesome,
Old 05-26-2014, 05:12 AM   #4
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 10,083

Rep: Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983Reputation: 2983
that is something called learning curve I think. You need to have practice by writing code and checking it and understanding. You can ask any time here if something is unclear (a specific case), but not in general. Just do it like you did yesterday....


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
Help with Awk and Printf, please! romeo0307 Linux - Newbie 16 05-08-2012 03:30 PM
this is how printf works smeezekitty Programming 5 09-24-2009 06:23 PM
How does printf work? Ephracis Programming 1 12-25-2004 04:06 AM
c printf question. fredgt Programming 5 09-09-2004 06:06 AM
printf new_user10 Programming 3 09-10-2003 12:12 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:14 PM.

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