www.digitalmars.com         C & C++   DMDScript  

c++.chat - what about tutoruls?

reply "Brian" <BAWolff shaw.ca> writes:
Well I'm using digital mars c++ so those things don't matter that much. I'm
more wondering about weather the stuff in the tourtorials are good. I was
hoping i'd find someone who actuly used it.

Thanks for answering

P.s. I'm mainly wondering because this program i wrote dosen't work and i've
heard about some online c++ stuff is bad.

P.P.S. This is my program maybe someone can point me in the right direction:

#include <iostream.h>

// I'm planing to make it more complex later this is just my first test
version

int main()

{

  char 1;

  cout<<"Do you want to learn about riverboarding? Y for yes N for no.";

  cin>>1;

  if(1==N)

  {

     cout<<"Too bad. Come back If you chang your mind.";


  }
  else if(1==Y)

  {
    cout<<"Good Choice"
    cout<<"This part is under construction. Plese use a updated version of
this program. Thank You and have a nice day."

  }

  else
  {
     cout<<"You Have to either put Y or N in, you put"1"in";
     cout<<"plese restart the program";
  {
// was going to make it loop but it wasn't working
  return 0;

{
Apr 24 2003
parent reply Cesar Rabak <csrabak uol.com.br> writes:
Brian escreveu:
 P.P.S. This is my program maybe someone can point me in the right
 direction:

 #include <iostream.h>

 // I'm planing to make it more complex later this is just my first
 test version

 int main()

 {

 char 1;
Your variable names cannot start with number, less being only '1'.
 cout<<"Do you want to learn about riverboarding? Y for yes N for
 no.";

 cin>>1;
Refer to this page and start coding this correctly: http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.2 (look specially at the line commented "BAD FORM").
 if(1==N)
if you intended to check if the user entered an "N" you must use 'N' otherwise the compiler will complain on not finding a N variable.
 {

 cout<<"Too bad. Come back If you chang your mind.";


 } else if(1==Y)

 { cout<<"Good Choice" cout<<"This part is under construction. Plese
 use a updated version of this program. Thank You and have a nice
 day."

 }

 else { cout<<"You Have to either put Y or N in, you put"1"in";
 cout<<"plese restart the program"; { // was going to make it loop but
 it wasn't working return 0;

 {
You will profit on spending some time reading a good C++ textbook so you grasp more the syntax of C++. HTH -- Cesar Rabak GNU/Linux User 52247. Get counted: http://counter.li.org/
Apr 24 2003
parent reply "Brian" <BAWolff shaw.ca> writes:
Thanks Your help is apretiated.

p.s. sorry that message was ment to be attached to my other post
Apr 26 2003
parent reply "Phil Thompson" <phil electricvisions.com> writes:
If you are new to programming I suggest you start with a simpler language
such as Basic or Java. I say Java because java.sun.com have some very
excellent tutorials that will help you get started. They also help you get
used to OO. Java is also quite rewarding in that it doesn't take much effort
to do some pretty neat stuff.

If you really want to give C/C++ a go then start with a good beginners C
book. Preferably one that is not too thick (looks like a reference manual).
The series like ... for dummys or ... for idiots are generally good books
and explain things in a very straightforward way.

Once you've got the hang of it take a look at www.relisoft.com for a proper
and practical way to program C++ and Windows (If Windows is what you want
that is). This site is full of great tutorials and I heartily recommend the
book C++ in Action.

One peice of advice, C++ should not be treated as an extension to C. If you
make this assumption you will not write proper object oriented code.

I hope at least some of this information was useful to you.

Regards,
Phil

"Brian" <BAWolff shaw.ca> wrote in message
news:b8efno$2km7$1 digitaldaemon.com...
 Thanks Your help is apretiated.

 p.s. sorry that message was ment to be attached to my other post
Apr 28 2003
parent reply "Brian" <BAWolff shaw.ca> writes:
"I'm still not sure what "object oriented"means.

I might go to Java. I know HTML pretty good(:
Apr 28 2003
parent "Gregory Peet" <admin gregpeet.com> writes:
"Brian" <BAWolff shaw.ca> wrote in message
news:b8k8f4$63p$1 digitaldaemon.com...

 "I'm still not sure what "object oriented"means.
Everything is an object. In HTML, you have gotten use to a semi-linear style of programming. This is quite bad to start off with. A good way to begin thinking in terms of objects is to take out a piece of paper or whiteboard with something to write with. Think of something you like (I like cheesy horror movies). Begin thinking of all the objects that consist for what you are thinking of. For me, I'll use the movie Evil Dead as an example to derive objects: *Scarey Dark Cabin [this is where the movie takes place] *Ash (the hero) ["Come get some!"] *Demons [Did you expect rabid bunnies?] *Chainsaw [For chopping up possessed girlfriend/friend] *Shotgun [For hopelessly shooting at monsters you can't see] *Shotgun Round [We can't shoot air, now can we?] *Car [That obviously won't start to help you escape] *Girlfriend [Pretty until she becomes possessed] *Friend [A few of them, which end up becoming monsters too...again, look at the chainsaw object] *Cellar [Contains rats, bats, old hats, and evil democrats ;P] *Tape Player [Which recites evil words from the Necromonicon...damnit Ash, why did you have to play that?] Now, write each object that you thought of in separate areas on your paper/whiteboard with boxes around them. Next, begin thinking of what relates to what. Ash carries to the chainsaw and shotgun so I would draw an arrow pointing from Ash to Chainsaw and Shotgun. The Shotgun needs ammo, so draw an arrow from the rounds. The car doesn't work, so leave that alone (lol). The girlfriend is relative to Ash (no, not A relative), so draw an arrow from her to Ash. Ash is relative to her, so on the same line you used to draw an arrow to him, make an arrow on her side pointer at her (for a double-ended arrow). Ash has to chop her up, so draw an arrow from ash, to chainsaw, to her. Repeat this for the friends. The cellar is spooky, so leave that out. The tape player ends up unleashing the demon so draw an arrow-line from it to the demons. This is piss-poor example of course. However, if I was to make a game (which already exists) for the movie, I would have to make a class (which you will learn about) for each object. Each object has methods (internal functions). For example, the Ash class would contain the chainsaw and shotgun. The shotgun class would contain the Shotgun Round class. Ash would have a method called "void Chop_Up(Friend* who);" which would use the chainsaw on.
 I might go to Java. I know HTML pretty good(:
Java would be best route for learning object-oriented analysis and design. Every file is a class and contains at least a single method (the main). If you want, post something you like (movie, car, game, story), and if I know it, I can begin giving you examples of objects from it.
May 27 2003