want to learn C++

J

JoeC

I want to learn C++! does anyone have any advice?

Lee

Yes, get started. I personally like accelerated C++.
http://www.amazon.com/Accelerated-C...8120643?ie=UTF8&s=books&qid=1182463388&sr=8-1

It would depend on how much experience you have with programming.
Start by learning the compiler do a hello world program. Learn the
basics. A few years ago I was in the beginner mode. It is very
challenging. Take your time experiment. start with the standard
inputs and outputs. Learn the data types learn program flow. Don't
get too caught up with pointers, learn about the standard libraries
especially string and vector. C++ is a strict language but there are
ways to get around the strict rules. Learn the rules first.
 
R

red floyd

JoeC said:
Yes, get started. I personally like accelerated C++.
http://www.amazon.com/Accelerated-C...8120643?ie=UTF8&s=books&qid=1182463388&sr=8-1

It would depend on how much experience you have with programming.
Start by learning the compiler do a hello world program. Learn the
basics. A few years ago I was in the beginner mode. It is very
challenging. Take your time experiment. start with the standard
inputs and outputs. Learn the data types learn program flow. Don't
get too caught up with pointers, learn about the standard libraries
especially string and vector. C++ is a strict language but there are
ways to get around the strict rules. Learn the rules first.

Seconded. Also, DO NOT USE VISUAL C++ 6.0!!!!! If you're using
Windows, start with "console" programs, do not use MFC. Avoid
Microsoft-isms (stdafx.h and _TCHAR/_tmain). MinGW is available for
free and is highly Standard compliant (modulo "export"), and so is
Visual Studio 2005 Express, also compliant (assuming /Za. again modulo
"export").
 
H

Herhor

red floyd pisze:
Seconded. Also, DO NOT USE VISUAL C++ 6.0!!!!! If you're using
Windows, start with "console" programs, do not use MFC. Avoid
Microsoft-isms (stdafx.h and _TCHAR/_tmain). MinGW is available for
free and is highly Standard compliant (modulo "export"), and so is
Visual Studio 2005 Express, also compliant (assuming /Za. again modulo
"export").

I am also new in C++ programming. I use VC++ 2005 Express and that is
why I want to ask you about additional VC++ compiler/linker settings
which can assure the best ISO C++ standard compatibility because MS
created many self-owned C++ extensions, I don't interested at all.
 
J

Joshua Moore

depends on how much programming experience you have already.
If you have no experience, here is what helped me:
http://math.hws.edu/javanotes/
this is a great tutorial for java. learn that, the skills will
transfer over to c++ and the syntax is very similar. after that, you
can gather the rest from c++ code examples all over the web.

Josh.
 
R

red floyd

Joshua said:
depends on how much programming experience you have already.
If you have no experience, here is what helped me:
http://math.hws.edu/javanotes/
this is a great tutorial for java. learn that, the skills will
transfer over to c++ and the syntax is very similar. after that, you
can gather the rest from c++ code examples all over the web.

1. Do not top post. See
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.4

2. Java skills do not transfer easily to C++. Often what we see here is
people trying to write Java in C++ and making novice mistakes (new-ing
everything, etc..).
 
W

waltbrad

Seconded. Also, DO NOT USE VISUAL C++ 6.0!!!!! If you're using
Windows, start with "console" programs, do not use MFC. Avoid
Microsoft-isms (stdafx.h and _TCHAR/_tmain). MinGW is available for
free and is highly Standard compliant (modulo "export"), and so is
Visual Studio 2005 Express, also compliant (assuming /Za. again modulo
"export").

Interesting that you say this about msvc++6.0 Right now I'm in the
middle of Prata's C++ Primer Plus. Once done, I intended to work
through this tutorial:

http://www.stromcode.com/wiki/index.php?title=Main_Page/Tutorials/Win32_Tutorial

to get some experience of using C++ with the Windows API. The writer
of this tutorial seems to agree with you in that he urges users to
download vs2005. Right now I'm using Dev-Cpp and am somewhat
intimidated about using a different ide/compiler. Is the transition
pretty simple?
 
G

Gavin Deane

depends on how much programming experience you have already.
If you have no experience, here is what helped me:http://math.hws.edu/javanotes/
this is a great tutorial for java. learn that, the skills will
transfer over to c++ and the syntax is very similar. after that, you
can gather the rest from c++ code examples all over the web.

Please don't top-post. Thank you. Rearranged.

The OP wants to learn C++. You're the first person I've ever seen
suggest that they way to do that is to learn Java first. I can't
imagine how that can accelerate the process of learning C++. From what
I know of Java and of Java programmers trying to learn C++, I can
however imagine a lot of confusion for the OP if they go that route.

As for code examples on the web, I'm not sure that's a good idea in
general either. By definition, someone learning the language is
incapable of differentiating between the good examples and the awful
examples, and unfortunately there are a lot of the latter. I would
suggest the OP treats any C++ website with caution unless it comes
recommended by a reliable source. I would regard the general consensus
of this group as one reliable source.

To the OP: As well as "Accelerated C++", suggested elsethread, you
might want to look at "Thinking in C++"

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

I'm not personally familiar with it but it is often recommended in
this group. It's online and free.

Gavin Deane
 
S

Scoots

I'd say it depends on whether you are used to OOP (Object-Oriented
Programming) or not. If you're not, it can be horribly confusing.
Especially once you get into it and you suddenly have pointers flying
everywhere and not understanding when you're copying something and
when you're copying the address.

My suggestion if you don't know OOP, is you learn C#. C# on the very
basic level (before web, multi-threading, databases, etc), is fairly
close to C++. Infact, it's built off of it. I don't mean tinker
long, but long enough to learn how objects work, without having to
worry about the difference between a pointer and a reference. Once
you start to understand OOP (it shouldn't take too long), then
switching is much easier. Then it's just pointer manipulations of
what you've already done.

Obviously, some people will disagree with me. There are a lot of
places to start. Unfortunately, there are a lot of bad ones too.
 
M

Mike Wahler

Scoots said:
I'd say it depends on whether you are used to OOP (Object-Oriented
Programming) or not.

I'd say it doesn't. C++ is not inherently an 'OOP language'.
It does have built-in support for OOP, but that's only one
of many styles it supports.
If you're not, it can be horribly confusing.
Disagree.

Especially once you get into it and you suddenly have pointers flying
everywhere

(Raw) pointers are rarely needed in C++.
and not understanding when you're copying something and
when you're copying the address.

The copying of objects and how it works does need to be understood,
but imo that's not difficult at all.
My suggestion if you don't know OOP, is you learn C#.

C++ != OOP.
C# on the very
basic level (before web, multi-threading, databases, etc), is fairly
close to C++. Infact, it's built off of it. I don't mean tinker
long, but long enough to learn how objects work, without having to
worry about the difference between a pointer and a reference. Once
you start to understand OOP (it shouldn't take too long), then
switching is much easier. Then it's just pointer manipulations of
what you've already done.

Concentrating on pointers in order to learn C++ is imo a mistake.
Obviously, some people will disagree with me.
:)

There are a lot of
places to start. Unfortunately, there are a lot of bad ones too.

Yup.

-Mike
 
B

BobR

Gavin Deane wrote in message...
<snip>. I would regard the general consensus
of this group as one reliable source.

I'll second that.
To the OP: As well as "Accelerated C++", suggested elsethread, you
might want to look at "Thinking in C++"

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

I'm not personally familiar with it but it is often recommended in
this group. It's online and free.
Gavin Deane

Then why have you not DLed it/them?!? <G>

Add:

TiCpp has two volumes, and is available to *buy* in hardcopy form (Mr. Eckel
deserves to be paid for his work.), the 'online' version is free *and legal*
(not a rip-off like some sites have).
 
S

Scoots

'Obviously, some people will disagree with me.'

*Cough* ;-)

'C++ !=OOP'
--This is true. Depends on the application though. Object Oriented
Programming will almost 100% be required of you at some point. C++
doesn't make it all that friendly.

'pointers are rarely needed in C++. '
--Again, application dependant. What I'm writing right now is VERY
pointer dependant. But if you're learning you're going to want to use
a lot of pointers, because otherwise you really aren't learning C++ to
the extent it can be used.

For me, having learned C# first, c++ was learning a slightly new
syntax, and direct manipulation of pointers. Nothing else.
Fundamentally, c++ is a syntax, it isn't a revolutionary language, and
there are many other languages. For me, C++ WAS learning pointers.
Pointers are ONE of the things that distinguishes C++ as a 'more
powerful' version of it's anscestor, C. The use of pointers and OOP
is a major reason that people want to learn C++, not C. And, well,
true, you can write little programs, and even some larger programs
with c++, but if you do, without ever encountering a pointer, then why
not go write in basic?

To me, learning these fundamentals before the c++ syntax is 'the way
to go'. Learning syntax means nothing to me if I'm just following
tutorials and don't understand the programming concepts, and c++ isn't
the friendliest language around. I'm not promoting replacing c++ or
saying the only difference is pointers, but I've seen entirely too
many people struggle with OOP and pointers that I think learning c++
doesn't start with learning syntax. Instead, I think it begins with
learning to program. And I think that there are better starting
places than simply installing vc++ 6.0. (*twitch*)

That said, it's not like I'm an expert or anything. And if you
already know programming, there is absolutely no benefit in starting
the way I suggest. In which case, ignore my posts. You know, now
that you've read them. ;-)
 
M

Michael Ekstrand

'pointers are rarely needed in C++. '
--Again, application dependant. What I'm writing right now is VERY
pointer dependant. But if you're learning you're going to want to use
a lot of pointers, because otherwise you really aren't learning C++ to
the extent it can be used.

I suggest you go look again at the context - it was qualified with
'(Raw)'. If you're doing Java-esque OOP in C++, a common practice is to
use a smart pointer, such as Boost's shared_ptr or some other smart
pointer to facilitate some forms of automatic memory management (my
application uses a reference-counting smart pointer and a
weak-referencing counterpart extensively). Such a thing winds up being
extremely similar to object references in other languages (e.g. Java,
and I believe also C#, although I do not know C# myself).

In modern C++ usage, it is considered best to use some kind of a smart
pointer instead of a bare/raw/bald pointer whenever feasible.
Therefore, raw pointers are rarely needed in (modern/standard) C++.

- Michael
 
B

BobR

Scoots wrote in message...
'Obviously, some people will disagree with me.'

*Cough* ;-)

'C++ !=OOP'
--This is true. Depends on the application though. Object Oriented
Programming will almost 100% be required of you at some point. C++
doesn't make it all that friendly.

'pointers are rarely needed in C++. '
--Again, application dependant. What I'm writing right now is VERY
pointer dependant. But if you're learning you're going to want to use
a lot of pointers, because otherwise you really aren't learning C++ to
the extent it can be used.

WHOA, dude! You really, really need to go sit on the toilet for a long
while!

.... and, DO NOT Top-Post.

What the hell are you responding to?

If you want to discuss 'C#', then go to a 'C#' NG.
 
J

Jorgen Grahn

For me, having learned C# first, c++ was learning a slightly new
syntax, and direct manipulation of pointers. Nothing else.

I am pretty sure that this means you have not learned C++ yet.
Although I don't know C#, I am certain that the difference is more
than syntax and pointers, for non-trivial tasks.

The positive aspect of that is, I guess, that both languages have a
reason to exist.
Pointers are ONE of the things that distinguishes C++ as a 'more
powerful' version of it's anscestor, C. The use of pointers and OOP
is a major reason that people want to learn C++, not C.

Here you lost me. C has pointers, and always had them. A typical C
program uses way more pointers than a typical C++ program, and in
much more problematic ways.
And, well,
true, you can write little programs, and even some larger programs
with c++, but if you do, without ever encountering a pointer, then why
not go write in basic?

Because pointers is not what defines the difference between C++ and
BASIC?
And I think that there are better starting
places than simply installing vc++ 6.0. (*twitch*)

Finally something most people can agree on ;-)

To summarize my point of view: if you want to learn C++, learn C++ [0].
Not C, or C#, or Java, or BASIC.

Learning other languages too is fine, but don't expect them to be
deeply similar to C++ just because they use curly brackets. Most
importantly, don't expect the best solution to a problem to always be
similar between languages, just because they are object-oriented.

/Jorgen

[0] That's what Stroustrup always says, too; see his FAQ. But then he
would, wouldn't he?
 
G

Gavin Deane

Go to this link nice online tutoring given by him. try it out

<snip>

Given by him or given by you? If you are recommending you own
services, particularly where money might be involved, you should make
that clear so that everyone is aware of the potential conflict of
interest. If you are recommending the services of someone else who
just happens to share your name, then that's fine.

However, more fundamentally than all that, this newsgroup is about C++
and this thread is about learning C++. You posted a link to a C
tutorial. Why did you think that would help?

Gavin Deane
 
S

Scoots

It's obvious that my posts have been misinterpretted to be some sort
of arguement for C#, c++ and pointers. I think the main point of my
posts has been summarily lost, but to respond to your points and try
to argue my main point again would just drag this further off-topic
than it already is (though if you wish to know it, try reading my last
two paragraphs on that post instead of just picking apart the top
one). The comment on pointers was just a response that they were much
more apparent in c++ coding than they are in java or C#, where they
are largely transparent to a novice user. (by which I mean one new to
programming)

However, I think I'm managing to drag this more off-topic than on, so
I'll just say I was agreeing with JoeC, and trying to provide
suggestions on how to do just that. Not start discussions on bowel
movements or my experience in c++, however indirectly.

Cheers,
~Scoots
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,174
Latest member
RonnyLoren

Latest Threads

Top