473,899 Members | 2,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is "C For Dummies" any good?

Hello everyone.

I am new to programming and my uncle gave me a copy of "C For Dummies
2nd Edition". I am up to chapter 9 right now. He probably saw me
struggling with "The C Programming Language" by Ritchie and Kernigahn
and felt bad.

Does anyone have experience with this book? I feel that it is helping me
along pretty well. But how much will this book teach me? What would be
the next book to read?

--
K. G. Suarez

Nov 14 '05
60 4005

"Joona I Palaste" <pa*****@cc.hel sinki.fi> wrote in message
But you still have to know C, even if you don't use it as your main
development language. For instance have you never needed to translate a
routine written in C into Java?


Yes I have. But only once so far. And it was fairly simple C, with most
of the difficulty being in the algorithm itself.

I suppose it depends what sort of programs you write. Stealing snippets of
code is something I do constantly.
Nov 14 '05 #31


Rouben Rostamian wrote:
In article <rE************ *****@bignews2. bellsouth.net>,
K. G. Suarez <kg****@bellsou th.net> wrote:
Hello everyone.

I am new to programming and my uncle gave me a copy of "C For Dummies
2nd Edition". I am up to chapter 9 right now. He probably saw me
struggling with "The C Programming Language" by Ritchie and Kernigahn
and felt bad.

Does anyone have experience with this book? I feel that it is helping me
along pretty well. But how much will this book teach me? What would be
the next book to read?


I suggest that you don't read "C For Dummies". It has the potential
to mislead you.

I am basing this statement based on the author's VERY confused
rambling in:

http://www.c-for-dummies.com/lessons.../01/index.html

He shows a program that compiles and runs under Windows but
crashes under Linux. He appears to puzzled why this happens.

His problem is that he is trying to modify a string literal.
That's in violation of the C standard.

This is Question 1.32 in comp.lang.c's FAQ.

At least he should be given credit for his honesty.


I like how he blames in on linux.
Nov 14 '05 #32
Test.

--
K. G. Suarez
Nov 14 '05 #33
In article <20************ *********@Penny .Mine.org>,
K. G. Suarez <kg****@bellsou th.net> wrote:
Test.

--
K. G. Suarez


You fail. Go to alt.test. Go directly to alt.test. Do not pass Go.
Do not collect $200.
dave

--
Dave Vandervies dj******@csclub .uwaterloo.ca
Texas doesn't even rate by .us standards. I think their whole state
could practically fit into the *parks* in Alaska.
--J.D. Baldwin in the scary devil monastery
Nov 14 '05 #34
"Emmanuel Delahaye" <em***@YOURBRAn oos.fr> wrote in message
news:mn******** *************** @YOURBRAnoos.fr ...
[snip]
Why defining parameters you don't use at all ?
[snip] Why using 'float' instead of 'double' ?
[snip] (FAQ) The string is not terminated by a '\n'. Depending on the
platform, it may output on stdout or not. To be sure of it, force it:

fflush (stdout);
[snip] What happens if the user types a wrong entry ? scanf() is a difficult
function, not only for beginners. I suggest a combination of fgets()
and strtod().
[snip] What if the rate changes ?
[snip] Bare in mind that this 'trick' is due to your C implementation.


Greetings Emmanuel,

I think you may have missed an earlier post of mine in this thread, or maybe
just misunderstood it, so I'll post it again. I am brand new to any type of
programming, and I've only read nine chapters (small ones too) of an
incredibly basic approach to the C language. The only reason I even posted
that code was to show the OP how to put into practical use what was being
taught. He mentioned that he was only able to work and alter pre-made code,
and asked me what I was doing. With that said, I will try to answer your
questions.

#1. This was done by the DevC++ editor after I chose the option to create a
new project (console). Yes, I could have and should have, just used int
main().

#2. Why use 'double'? I wrote this program for myself to determine the cost
of an eBay auction that was in British pounds (this was before eBay provided
that info). I knew I would not be entering anything requiring 'double'.

#3. Sorry, I didn't get that far yet, so I made use of what I knew. I'll be
on the lookout for that though.

#4. I agree 100% with you on this. However, as above, I haven't yet learned
any other way of doing it yet.

#5. I was, and am aware of that, and it frustrates the hell out of me. As a
matter of fact, it does change quite often. What do you suggest?

#6. Yes, I understand that it is not very portable. But again, it was only
for my use (I know, that's no excuse), and it was really fun to go through
the thought process for designing it.

Best,
newby2c
Nov 14 '05 #35
"Rouben Rostamian" <ro****@pc18.ma th.umbc.edu> wrote in message
news:ce******** **@pc18.math.um bc.edu...
printf("Enter amount in U.S. currency to convert: ");


This needs to be followed by
fflush(stdout);

...more snipped...
system("pause") ;


Did the book tell you that "pause" is avaialble only on certain platforms?


Greetings Rouben,

Please see my reply to Emmanuel.

Thanks.
Nov 14 '05 #36
"newby2c" <se******@juno. com> writes:
[...]
#1. This was done by the DevC++ editor after I chose the option to create a
new project (console). Yes, I could have and should have, just used int
main().
Or, better yet, int main(void).
#2. Why use 'double'? I wrote this program for myself to determine the cost
of an eBay auction that was in British pounds (this was before eBay provided
that info). I knew I would not be entering anything requiring 'double'.


Type double typically has a greater range *and* precision than float
(though this isn't guaranteed). If you're dealing with reasonable
amounts of money, the extra range isn't going to matter, but the
precision could. Typical amounts of money (such as 0.10) aren't
exactly representable in binary floating-point. Using double rather
than float can alleviate, but not solve, this problem. See section 14
of the C FAQ, <http://www.eskimo.com/~scs/C-faq/faq.html>.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #37
"Bernhard Holzmayer" <ho************ ****@deadspam.c om> wrote in message
news:17******** *********@holzm ayer.ifr.rt...
My suggestion:

If you feel good with the book = it pleases you and you like the
style how it is written, then go ahead with it.


[snip]

Greetings Bernhard,

I know you wrote this to the OP and not I, but I just wanted to say that you
gave some great advice, and as a neophyte myself, I intend to follow it.

Best,
newby2c
Nov 14 '05 #38
newby2c wrote on 26/07/04 :
Why defining parameters you don't use at all ?
#1. This was done by the DevC++ editor after I chose the option to create a
new project (console). Yes, I could have and should have, just used int
main().
Ok, or int main (void)

that clarifies your intention.
Why using 'float' instead of 'double' ?


#2. Why use 'double'? I wrote this program for myself to determine the cost
of an eBay auction that was in British pounds (this was before eBay provided
that info). I knew I would not be entering anything requiring 'double'.


double are used for computing because they have a better precision. Any
float will be converted to a double (with a cost in terms of code space
and CPU time) before being processed (computing, function parameter
etc.).

Better to have it as the basic type that double is. float being
generally smaller (hence less accurate) than double, they are used to
store big arrays of values when high precision is less required than
room.

Note that if you inist in using scanf() with the address of a double,
the correct formatter is "%lf". (point #4)
(FAQ) The string is not terminated by a '\n'. Depending on the
platform, it may output on stdout or not. To be sure of it, force it:

fflush (stdout);


#3. Sorry, I didn't get that far yet, so I made use of what I knew. I'll be
on the lookout for that though.


It is well explained in the FAQ. It's an implementation-dependent issue
that concerns portability. Don't forget that here, on c.l.c, we are
speaking of the C-language, independently from any implementation.
Hence, we try to stay portable.
What happens if the user types a wrong entry ? scanf() is a difficult
function, not only for beginners. I suggest a combination of fgets()
and strtod().


#4. I agree 100% with you on this. However, as above, I haven't yet learned
any other way of doing it yet.


I still don't understand why book writers do continue to teach scanf()
before gets()... Kinda mystery to me...
What if the rate changes ?


#5. I was, and am aware of that, and it frustrates the hell out of me. As a
matter of fact, it does change quite often. What do you suggest?


At minimum, a command line parameter to avoid to recompile the program
each times! Incidently, it will give you the opportunity to learn how
to manage the command line parameters and the

int main (int parameters_coun t, char ** array_of_string s)

form of main.
Bare in mind that this 'trick' is due to your C implementation.

#6. Yes, I understand that it is not very portable. But again, it was only
for my use (I know, that's no excuse), and it was really fun to go through
the thought process for designing it.


We are not supposed to post system dependent code in here.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

"C is a sharp tool"

Nov 14 '05 #39
"Keith Thompson" <ks***@mib.or g> wrote in message
news:ln******** ****@nuthaus.mi b.org...
Type double typically has a greater range *and* precision than float
(though this isn't guaranteed). If you're dealing with reasonable
amounts of money, the extra range isn't going to matter, but the
precision could. Typical amounts of money (such as 0.10) aren't
exactly representable in binary floating-point. Using double rather
than float can alleviate, but not solve, this problem. See section 14
of the C FAQ, <http://www.eskimo.com/~scs/C-faq/faq.html>.


Thanks for the explanation, Keith.

newby2c
Nov 14 '05 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2202
by: limperger | last post by:
Hello everyone! I'd like to know your opinion about the book Access VBA 2007 Programming for Dummies, as a way to learn Access VBA fundamentals. Could anyone here recommend any other book on this topic, in an introductory level? Best regards
0
9997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11276
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8043
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7204
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6082
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4301
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3320
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.