Griffin1997
I’ll definitely get an IDE. Either of these seem to be more than adequate for me.
Thanks very much for the advice
Testy
Griffin1997
I’ll definitely get an IDE. Either of these seem to be more than adequate for me.
Thanks very much for the advice
Testy
Chronos
Good ol’ man pages. I haven’t used those in a VERY long time. Thanks for that command line, I’m sure I’ll be giving it a hell of a workout!
Testy
Psychonaut (a few posts above) is right that most tutorial sites and most teach-yourself books are utter crap. So you do have to shop around. Most web sites, at least, are free. That’s why I suggested those google searches so you could check them out yourself, rather than pick just a few to name. I am sure there are some good beginners tutorial sites out there, among all those. I think you should look for tutorials that walk you through a series of examples, step-by-step, rather than those that focus too much too early on computer science theory and stuff like that. The GNU compiler is plenty simple enough (and free enough), as already noted up-thread.
Fairly early in your C/C++ self-education (although not necessarily immediately) you should start learning make too. There are even tutorials on that.
ETA: “. . . haven’t found found what I’m looking for.” Is there something more specific that you are looking for in a C teach-yourself source?
For a beginning programmer in any language, I think I would recommend against using an IDE. That’s great for some more advanced users – in particular if you’re actually trying to get a real project done. For a beginning learner, two problems:
(1) It it a crutch that does for you too much that you should be learning yourself. It’s like using a calculator to learn beginning arithmetic. For example, if it does too much for you towards finding your errors, it becomes like learning to fly an airplane with an autopilot.
(2) The IDE itself takes learning how to use, which just absorbs a certain amount of your brainpower that should be focused on learning the language and the library. You may spend too much time just learning how to use the IDE. You might also not always be too sure what details your are learning are part of the language and what details are part of the IDE.
Senegoid
Thanks for the advice on “Make.” I’m not sure what that does at the moment but I’ll look for it and try to make use of it.
As far as the IDE goes, I’ve used a sort of basic IDE before and yes, wound up learning quite a bit about it at the expense of learning the language. This is a very good point and I’ll take it to heart.
Thanks for everything
Testy
I have a “C for dummies” book and a couple of others that I’ll try to get through to get at least a basic understanding and then start on the on-line tutorials. Hopefully, this will give me sufficient knowledge to determine which sites are at the level I need.
This one will make a wonderful doorstop, or kindling in the event of a serious power outage. Under no circumstances should you actually read it.
Testy, you haven’t told us how much (if anything) you already know, which might help us in offering suggestions. Do you already know another programming language, and if so, very well? Have you written in, for example, Visual Basic? Why are you wanting to learn a programming language, and why C? Why not Java, or JavaScript, or PHP, or COBOL? Do you have specific goals you are after? Some sort of project you want to do? Learn an employable job skill? Are you at all technically familiar with computers, beyond the “dumb end user” level? How much do you know about using this Fedora system you are getting? Are you going to install it all by your very self? Do you know how to use a text editor, beyond the bare-bones basics? Etc.
From your questions and remarks, I gather that you aren’t a bare-naked new-born noob here. Sounds to me like a rank amateur, you aren’t. So I think you don’t need or want a really overly dumbed-down book.
I suggest, in particular, that you spend exactly 0 minutes and 0 seconds studying any “Dummies” type of book. They really, really are for dummies who have no serious intention of becoming non-dummies, IMHO. If you can spell “C”, you are already way beyond that. I’m sure any of your other books must be better than that.
Look for a book that actually gets you started doing simple, then progressively more complicated, exercised, starting right in Chapter 0. Avoid books that go too deeply into all the theory too early.
I had a Pascal (shudder) textbook once that had THREE full chapters of introductory theory (probably abstruse for a beginner), before the student got to write one line of code in Chapter 4.
ETA: Just noticed that Derleth has already entered a similar opinion of Dummies books, and well stated. What he says!
Hi Senegoid
Sorry, I should have given a little background. I started out as a hardware tech on SSBNs in '74 when systems had actual magnetic donuts as memory. Went from there to civilian super-minis based on DEC PDP, VAX and Microvax systems and from there to custom processor-based UNIX systems. From there I went into management and lost every technical skill I ever had. How embarrassing!
I have a project in mind for messing with the internals of MP3 files but have no idea whether it will work or not. I have done some programming, introductory Java, some Basic, (not VB, just B) and some Fortran. Nothing more than simple programs in any of these. I have messed with some C code previously when I was using the UNIX systems but again, nothing advanced in any way. The little programming I’ve done is all decades ago.
So, I’m a noob at programming but pretty experienced with systems in general.
I picked C++ because I have done some C previously (way previously!) and generally enjoyed it.
I’m doing this under Fedora simply because I have an older system around the house that would choke on Vista/Windows 7 and I enjoy the control and security available under UNIX. If I get any of the projects I have in mind to work, I’ll try to port this code to a Windows platform.
So, that’s pretty much me in a nutshell. And by the way, I appreciate you taking the time to lead me by the hand on this. It’s a really decent thing to do for a stranger.
Thanks again and best regards
Testy
Then you are clearly waaaaaaaaaaay beyond what any Dummies-type of book could do for you. I’m less certain now of just what kind of help you are asking for. It’s perfectly clear that you can find and study on-line tutorials or printed books on your own. But I’m wondering now if you had more specific, or more advanced, or more technical questions in mind. Like maybe something about how to set up data structures or objects to deal with bit-fields in MP3 files, or something detailed like that. (In which case, I’m not necessarily the one to help you. I never really got all into object-oriented programming that deeply. I was actually more of a FORTRAN-and-assembly-language nerd back in the 70’s.)
[sup]And I wrote big hungus TECO macros when I wasn’t out in the rain feeding the dolphins.[/sup]
Testy: So you want to learn C++ more than you want to learn C, then? They’re not the same language; even aside from the obvious technical changes, idiomatic C++ is vastly different from idiomatic C, just like Java and C# have a different style than C++.
Templates are a big part of this: C++ has a way to do ‘generic programming’ such that you can have, say, a single ‘sum()’ function that works the same way for all numeric types, something you really can’t do in C. This greatly influences how programs are structured.
And then, of course, there’s objects, operator overloading, a lot of new standard functions, new standard types, and other aspects I’m sure I’m missing. My point is, C++ is a new language and really needs to be approached as such.
Bjarne Stroustrup agrees with me in this PDF titled “Learning Standard C++ as a New Language”. (Bjarne Stroustrup is the guy who invented C++.)
Also, Senegoid is right: If you know how to write working C code, you’re well beyond the “For Dummies” stage. If you want some help getting back up to speed on C, especially on a Unix-like platform, I likely know enough to answer your questions. I’m not nearly as good with C++.
Also, the C++ compiler in the GCC family is called g++; gcc only works on C.
I agree and suggest OP focus on one or the other. C and C++ have, in some important ways, completely opposite philosophies and appeal to programmers of opposite tastes. (In fact, I find the conflating phrase “C/C++” to be annoying for this reason.)
Well, they are very closely related, in that any valid C program is also a valid C++ program. And many programmers are primarily C programmers, but end up slipping in a few C++ constructs here and there: That is to say, technically the language they’re using is C++, but almost identical to C.
I’ve never really learned C++, though, so I can’t say whether it’s easier to learn it this way, or as a completely separate language.
I took a class based on this book – the teacher insisted we buy an older used edition rather than the pricier new edition. Mine was like $6. There’s also a Study Guide with solutions and some helpful hints which can be had free.
There’s no nonsense, but it does presuppose a bit that you know what things like loops and such are (it explains them, but it’s up to you to find out how and when to implement them in actually writing code).
FWIW I used Borland Turbo C++ compiler at the time, which I think is free, but I don’t know if it’s ported for Linux. gcc seems to be what everyone on Linux uses.
C’s a great language, and I’m still learning nuances of mastering pointers and streamlining to make elegant code. Just a hobby, but I think I might get a double BS in EE and CS if my time permits. It’s just as fun as doing crossword puzzles, if sometimes more frustrating!
Then you can write a program to solve crossword puzzles! I did that circa 1970, in FORTRAN. If you get a crossword puzzle book, look at the “Skeleton Puzzles” or “Kriss Kross Puzzles”. It did those kind.
Testy, think about whether you are particularly interested in C-like stuff or in Object Oriented programming. There is some body of opinion out there that:
– Where OOP is important or otherwise of interest, C++ is a poor choice of language for doing it. Java is certainly much cleaner in the OOP department, although it certainly has its critics too. Also, look for other good OOP languages. C++ seems to include some contrived contortions to make it a true super-set of C, and it retains from C a serious facility to make a mess of things (e.g., despite all efforts to prevent it, you can still mess up your pointers, walk over array boundaries, character string overflows, have memory allocation problems and leaks, stuff like that). Multiple inheritance has also been criticized as a difficult abomination to deal with. Other languages that were designed from the ground up to be OOP, like Java, are much cleaner in some ways. (Note, personally I’m not pushing Java. I don’t care much for it.)
– Conversely, if you are specifically interested in the C/C++ family of languages, then I’ve often heard it recommended that C is the language to stick with. I’ve heard it said, for example, that there is a much greater job market for C programmers than C++, largely because of the perceived problems with C++ And I’ve heard it argued, for example, that any project that might be done with C or C++ is more easily, quickly, and reliably done with plain old C instead; OTOH, if a OOP seems really to be the right way to do a project, then use Java or any other OOP language. I’ve gotten the impression that C++ may not be proving to be a long-term successful language and may drop out of favor, somewhat like Pascal has.
No, this is not true on a purely factual level. There are a lot of C constructs that are good practice in C but invalid in C++.
It’s worse: C++ is not a true superset of C; instead, it retains enough of C to, for example, make garbage collection impossible to add cleanly among other massive annoyances, but doesn’t give you enough of C to allow you to program in just that subset without conforming to a bizarre notion of ‘purity’ and ‘safety’ enforced by the compiler.
Take this from someone who codes C++ daily for a living. You don’t want to learn C++. If you want to mess about with MP3 file internals C is very likely a better answer anyway. C++ is pretty much the wrong answer to any question except “what are lousy languages.”
You can be happy and use a restricted subset of C++. Stay away from templates. If they didn’t cause so much angst and difficult to debug code they would be hilarious. C++ essentially tries to implement a huge raft advanced programming concepts, but because of its original design goals it finds it almost impossible to actually succeed at any of of them.
Try here for why.
A note on gcc. It once was true that gcc was the “Gnu C Compiler” and only compiled C code. It is now the “Gnu Compiler Collection” and will cheerfully compile any of the supported languages. In fact if you look far enough into the command line options you can find the switches to force it to behave as one language or another. g++ is a wrapper for gcc that tweaks a few things to make it behave better for C++. But gcc, if presented with a file ending in .cpp will compile it as C++. g77 for Fortran, but again gcc will also compile a Fortran source if it ends in .f And so on.
I knew this (and it’s ‘GNU’; it’s an acronym).
It’s almost certainly not worthwhile to actually learn how to do this, when everyone else is just using the ‘g++’ command line invocation.
Ah. OK. I didn’t know this.
And it isn’t quite true: To compile C++ code with gcc (invoked like that) you need to add a command line option to link in libstdc++:
cc hello.c++ -o hello -lstdc++
Otherwise, it doesn’t find the required libraries and compilation dies in the linkage stage.
That is the bit why I wrote “tweaks a few things to make it behave better for C++”. If you are building a larger system, you will typically be controlling the linking explicitly anyway. It is really nit picking in the extreme anyway.
Hey, I’m a C programmer. If I wasn’t nit picking in the extreme, I’d blow my own leg off every time I tried to deal with user input.