Learning C++, more or less...

R

Rich Grise

Well, since deciding I wanted to pursue this, it's only taken
me three weeks or so to finally click my way to
http://www.research.att.com/~bs/3rd.html .

I'm getting the impression that the snippets from this book,
and various on-line tutorials, of which so far 2/3 have been
teaching C with C++ grammar, is the best I can do for free. :)

I did find a good tutorial, though, that actually is about
OOP in general, getting to C++ for his examples in about chap.
6 or so:
http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html

It's very enlightening - in a couple of weeks, I'll probably be able
to understand the questions in the NG! :)

Cheers!
Rich
 
D

David Hilsee

Rich Grise said:
Well, since deciding I wanted to pursue this, it's only taken
me three weeks or so to finally click my way to
http://www.research.att.com/~bs/3rd.html .

I'm getting the impression that the snippets from this book,
and various on-line tutorials, of which so far 2/3 have been
teaching C with C++ grammar, is the best I can do for free. :)

I did find a good tutorial, though, that actually is about
OOP in general, getting to C++ for his examples in about chap.
6 or so:
http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html

It's very enlightening - in a couple of weeks, I'll probably be able
to understand the questions in the NG! :)

Thinking in C++ (http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html)
is another good free resource.
 
R

Rich Grise

David said:
Thinking in C++ (http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html)
is another good free resource.
I've also been lurking, and following the thread about a 2D matrix with
some interest. It seems to me that it's not a built-in concept - they do
mention arrays, but so far it isn't clear if an ordinary array is a valid
C++ construct, just for old times' sake or something, but a 2D array seems
to be out of the question.

Well, the 2D array I have in mind isn't the kind of thing that you could
handle with any elegance as a vector, list, or map, that I can see, unless
you would create a new class Array2D or something, which wouldn't be hard at
all. The matrix I have in mind, of course, is something like you'd see on
minesweeper or "the game of life." Static, and each element has a state.

Maybe that's one of those times when an entirely nother language might
be more appropriate, like APL or something. ;-)

Then again, one of the tutorials is talking about point(), line(),
rectangle(), circle(), and such - maybe they'll get to "plane" and define
an XY array. I guess I'll find out! ;-)

Cheers!
Rich
 
M

Mike Wahler

Rich Grise said:
I've also been lurking, and following the thread about a 2D matrix with
some interest. It seems to me that it's not a built-in concept - they do
mention arrays, but so far it isn't clear if an ordinary array is a valid
C++ construct,

Sure it is. The syntax is the same as in C.

int array[10];
just for old times' sake or something, but a 2D array seems
to be out of the question.

Not at all.

int arr2[10][10];
Well, the 2D array I have in mind isn't the kind of thing that you could
handle with any elegance as a vector, list, or map,

A vector is the container that models an array. One can
indeed create a vector of vectors (of vectors, etc.).
"Elegance" is in the eye of the beholder, so I won't go there.
that I can see, unless
you would create a new class Array2D or something, which wouldn't be hard at
all. The matrix I have in mind, of course, is something like you'd see on
minesweeper or "the game of life." Static, and each element has a state.

The 'state' of an array element would be its value.
Maybe that's one of those times when an entirely nother language might
be more appropriate, like APL or something. ;-)

C++ can handle it just fine.
Then again, one of the tutorials is talking about point(), line(),
rectangle(), circle(), and such - maybe they'll get to "plane" and define
an XY array. I guess I'll find out! ;-)

const size_t X(10);
const size_t Y(10);

int array[X][Y];

-Mike
 
J

jeffc

Rich Grise said:
Well, the 2D array I have in mind isn't the kind of thing that you could
handle with any elegance as a vector, list, or map, that I can see

I think that either a vector of vectors or a map would do very nicely. A
vector of vectors *is* a 2D array (abstractly speaking), and a map gives
some additional niceties depending on what you're trying to do.
 
P

puppet_sock

Rich Grise said:
I'm getting the impression that the snippets from this book,
and various on-line tutorials, of which so far 2/3 have been
teaching C with C++ grammar, is the best I can do for free. :)

Hum. For free. Yes. Is your budget really so empty you can't afford
even one book? I'd suggest you go get yourself a copy of Koenig and
Moo _Accelerated C++_. They put your feet on the right path pretty
early on in the game.
Socks
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top