468,553 Members | 1,304 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,553 developers. It's quick & easy.

want to learn C++

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

Lee

Jun 21 '07 #1
21 1635
On Jun 21, 4:40 pm, Lee.k...@gmail.com wrote:
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%...2463388&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.

Jun 21 '07 #2
JoeC wrote:
On Jun 21, 4:40 pm, Lee.k...@gmail.com wrote:
>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%...2463388&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").
Jun 21 '07 #3
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.
Jun 22 '07 #4
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.

Lee.k...@gmail.com wrote:
I want to learn C++! does anyone have any advice?

Lee
Jun 22 '07 #5
Joshua Moore wrote:
>
Lee.k...@gmail.com wrote:
>I want to learn C++! does anyone have any advice?
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-lit...t.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..).
Jun 22 '07 #6
>
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....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?

Jun 22 '07 #7
On 22 Jun, 02:24, Joshua Moore <joshu...@gmail.comwrote:
Lee.k...@gmail.com wrote:
I want to learn C++! does anyone have any advice?
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/...ngInCPP2e.html

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

Gavin Deane

Jun 22 '07 #8
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.

Jun 22 '07 #9

"Scoots" <bs*******@traxcorp.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
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

Jun 22 '07 #10

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/...ngInCPP2e.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).

--
Bob R
POVrookie
Jun 22 '07 #11
'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. ;-)

On Jun 22, 2:23 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
"Scoots" <bssalm...@traxcorp.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
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

Jun 22 '07 #12

Scoots wrote in message...
>
My suggestion if you don't know OOP, is you learn C#.
What Mike said!!

Where the hell is 'C#' for GNU/Linux?

--
Bob R
POVrookie
Jun 22 '07 #13
BobR <re***********@worldnet.att.netwrote:
Where the hell is 'C#' for GNU/Linux?
http://www.mono-project.com/
But now this is drifting OT.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Jun 22 '07 #14
On 2007-06-22, Scoots <bs*******@traxcorp.comwrote:
On Jun 22, 2:23 pm, "Mike Wahler" <mkwah...@mkwahler.netwrote:
'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

--
Confused by the strange attachments? I cryptographically sign my
messages. Search Google for PGP for details.
Jun 22 '07 #15

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.

--
Bob R
POVrookie
Jun 23 '07 #16
On Fri, 22 Jun 2007 12:38:43 -0700, Scoots <bs*******@traxcorp.comwrote:
....
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?

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Jun 24 '07 #17
Go to this link nice online tutoring given by him. try it out
http://www.learnersparadise.com/ment...ogramming-in-C

Jun 25 '07 #18
On 25 Jun, 13:30, abhay <abhaybigb...@gmail.comwrote:
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

Jun 25 '07 #19
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

Jun 25 '07 #20

Scoots wrote in message...
>
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.
Then I must apologize. I'm sorry.

--
Bob R
POVrookie
Jun 25 '07 #21
On Mon, 25 Jun 2007 06:46:03 -0700, Scoots <bs*******@traxcorp.comwrote:
It's obvious that my posts have been misinterpretted to be some sort
of arguement for C#, c++ and pointers.
Well, you /did/ write a lot about that, and nothing prevents me or
anyone else from commenting on it. Especially when correcting obvious
factual errors (like the absence of pointers in C).
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
I don't think any of this is too offtopic yet.
(though if you wish to know it, try reading my last
two paragraphs on that post instead of just picking apart the top
one).
I assume you mean <11**********************@i13g2000prf.googlegroups .com>
and the part that starts:

"To me, learning these fundamentals before the c++ syntax is 'the
way to go'."

My response didn't quote that part, but it addressed it: "if you want
to learn C++, do not learn another language". To be fair, I didn't
motivate that answer.

regards,
/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Jun 26 '07 #22

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Aziz McTang | last post: by
9 posts views Thread by Eric | last post: by
182 posts views Thread by Jim Hubbard | last post: by
89 posts views Thread by Homer J Simpson | last post: by
6 posts views Thread by damod.php | last post: by
2 posts views Thread by harpreetsingh911 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.