Advertisement

Help me! - Classes, pointers and arrays

Started by May 24, 2000 03:15 AM
11 comments, last by nramsbottom 24 years, 6 months ago
I'm pretty new to C and the education (ha!) that I received in it was far from sufficient. The most advanced part of it was learning how to pass pointers to a function! Please could anyone point out any VERY well commented beginner code. I read people talking about classes and such but when I try to implement them it just does not work. I have 3+ years of VB experience but i'll be damned if I can learn C++ Thanks for any help. Compiler: MSVC++ 6 OS: Windows 98/NT4/NT5 N Ramsbottom P.S. For those who would respond with "buy a book for £x", I have three Microsoft books, one of which claims you need not know any C or C++ to use. Not the case. Edited by - nramsbottom on 5/24/00 3:24:55 AM
"I live to give"
http://www.itknowledge.com/reference/dir.programminglanguages.html

has books you can buy, but they also let you view the complete books online for free.

just pick one and start =)
Ries
Advertisement
Heh, most things i know about classes ive learned from the "2d vector" article... (ok, i dont know THAT much about classes...)



========================
Game project(s):
www.fiend.cjb.net
=======================Game project(s):www.fiend.cjb.net
I learned a lot from "C++ for Dummies". Most of these "for dummies" books are pretty well written. The MS books, with the exception of "Programming Windows 95" by C.Petzold tend to assume you know the subject already.

BTW: I''d suggest avoiding classes initially, learn the basic coding skills first.
I don''t work for about.com, but try their C/C++ section out, it gave me a good boost up to the point where I could ask questions and understand the answers here on the fourm. Right now, I am searching for a good STL reference guide, which I consider requiring a bit more advanced knowledge.

There is a free book (online) available from a link in the Beginner C++ section at about.com that is simply called ''C++ in 24 hours''. I''ve not looked it over, but it is a popular book.
Hiya,

I found a set of CD''s that step you through C, C++ and Windows Programming (STL). It''s called www.cdlearning.com. I can''t say that it''s all encompassing, but it certainly helped me grasp concepts that I couldn''t understand from books.

(note: I recently went to www.cdlearning.com and it wasn''t working...may be under construction. Keep checking though, it''s cool.)

Good Luck!

-Krylar
Advertisement
Sorry, but from what i''ve read of C++ for Dummies, it is crap. Now i''m just beginning too(3 months) but i''ve got a pretty good handle on this stuff and i''ll tell you.
SAMS C++ in 21Days/24 Hours is pretty good(its what i learn(ed/ing) from. At least with the SAMS books, you can see your work printed out on scren when you type the examples C++ for Dummies are there, but no cout''ting and they just do their thing and quit.

-Run_The_Shadows
-Run_The_Shadows@excite.com
C++ for Dummies is great! Regardless of what you''ve heard about that book, it''s great! The only thing though is that it is made for C programmers moving to C++, so you won''t get much out of it unless you know C first.


- null_pointer
Sabre Multimedia
The best book for C++ is Sams teach yourself C++ in 21 days. However you don''t need to know C before you learn C++.When I learned C++ 2 years ago that book taught me everything I needed to know. A good book to read after that is Sams teach yourself data structures and algorithms in 24 hours.
classes are simple and the basis of c++.

class Dog
{
public:
// constructor
Dog(int age = 0){m_nAge = age;}

// accessor
int GetAge(void){return m_nAge;}

// modifier
void SetAge(int age){m_nAge = age;}

// some function a dog performs
void Bark(void){cout << "Ruff ruff.\n";}
};
// end Dog

...
// in main

Dog dog(5);

dog.Bark();

cout << "dog has " << dog.GetAge() << "years.\n";



ECKILLER
ECKILLER

This topic is closed to new replies.

Advertisement