Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C ADD ADD

Name: Anonymous 2009-08-27 14:26

I'm trying to become an expert programmer but in every book I have tried to use, the example code never works with modern compilers.
Has anyone else has this problem?
What the fuck is this?

Name: Anonymous 2009-08-27 14:27

try C SQUARE-ROOT SQUARE-ROOT

Name: Anonymous 2009-08-27 14:31

Also, you are not an EXPERT PROGRAMMER if you do not master the POWER OF BBCODE

Name: Anonymous 2009-08-27 14:32

C22

Name: Anonymous 2009-08-27 14:33

haha C++ is such a fucking mess.

Name: Anonymous 2009-08-27 14:37

The solution is to not use C++.

Name: Anonymous 2009-08-27 16:44

What compiler are you using
Try a different/older compiler

Name: Anonymous 2009-08-27 18:04

>>3
Master the POWER of BBCode!

Name: Anonymous 2009-08-27 18:25

COMPILE MY ANUS

Name: Haxus the Defiant 2009-08-27 18:35

I respectfully disagree with >>██

Name: Anonymous 2009-08-27 18:52

Actually, you're wrong.

Name: Anonymous 2009-08-27 19:38

I don't know about you OP, but for any language I learned (which can have compiled,interpreted, or both implementations), the implementations I used just worked. I usually don't copy the code verbatim unless I understand it, and if I understand it, I'm able to tell what is wrong: it's rarely the compliant implementations. This was true at least for C89, CL, C#, Pascal, O'Caml, x86 asm and even the clusterfuck that is PHP.

Unfortunately(or fortunately?) for me, I've never seriously tried to learn C++ (I did skim through Bjarne's book), so I haven't had your problems OP. I've only used a small subset of it when it was strictly necessary that I use C++ (interface/work with someone else's C++ code).

Name: Anonymous 2009-08-27 20:37

OP:
1) Read and try to understand the code
2) Try to solve the problem without copying the code
3) Compare your working code to the book's
4) dicks

Name: Anonymous 2009-08-27 20:39

lol, are you using visual studio, OP?
use gcc

Name: Anonymous 2009-08-28 3:39

>>14
Terrible advice. GCC is a fucking relic; it supports way too much to be as effective as it could be.

http://en.wikipedia.org/wiki/GNU_Compiler_Collection#Languages

Look at that shit. There's no way it can be more effective at compiling those than a dedicated compiler.

Name: Anonymous 2009-08-28 6:27

>>15
IHBT

Name: Anonymous 2009-08-28 10:31

>>15
At this point, GCC strives to be complete as opposed to focused. It's fine to recommend GCC when you need to get jobs done. Of course, if you need something specfic, then maybe something else could be recommended.

Name: Anonymous 2009-08-28 12:07

>>15
The guy is coding out of a fucking book, not making real time targeting logic for smart bombs.

Name: Anonymous 2009-08-28 15:49

>>1
welcome to programing .

Name: Anonymous 2009-08-28 20:38

>>17-18
Good points. Also, real time targeting logic for smart bombs probably shouldn't be optimized at all as that may introduce bugs.

Name: Anonymous 2009-08-29 3:40

>>15
>>Architectures
>>Motorola 68000

Holy crap awesome.  I'm gonna go program shit for my genesis.

Name: Anonymous 2009-08-29 5:56

>>21
m68k was the first architecture GCC supported. Nowadays m68k means "ColdFire", but plain old m68000 should still work.

Anyway, the OP's problem is either that the book is so new that compilers don't yet support the features, or the book is so old that it predates the current language standards.

In the first case switching to the newest version of GCC is probably the best bet as they're usually on top of language features. There are other compilers that are as good or better at this than GCC, but they cost money.

In the second case, throw away the book and get a more current one. You may be able to coax the compiler to build the example code, but learning an outdated version of the language is counter-productive and ultimately destructive.

Of course the example code in the book may just be shit. It's more likely than you think. Check the book's webpage for errata.

Name: Anonymous 2009-08-29 8:06

Make sure you're using a suitable project type if you're using an IDE. There's all kinds of odds and ends like makefiles and such which are never covered in (as far as I've seen) any book on C++, but are needed to make some forms of code compile properly.

Name: Anonymous 2013-03-13 12:33

How is that even possible.

Don't change these.
Name: Email:
Entire Thread Thread List