LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-26-2005, 01:22 PM   #1
Rubedogg
LQ Newbie
 
Registered: Nov 2004
Location: Bay Area, CA
Distribution: FC3, SUSE 9.1, Xandros, Mandrake 10.1, Slackware 10, and Ubuntu
Posts: 29

Rep: Reputation: 15
Question Learning C++ question.....


Not sure if I should have posted this in the general forum or here, so here goes...
I am completely new to C++ programming, as a matter of fact I am just starting a class on it and wanted to find a forum or website that I can go to for help or questions. I mostly come to these forums for Linux questions (obviously). I wanted to see if anyone new of someplace that I could go to with my questions and actually get help in understanding C++. I do have some (very little) background on BASIC and PASCAL (this was a long time ago and have since forgotten it most or all) so programming and basic understanding of things are not really hard to grasp for me. If anyone could point me in the right direction, I would greatly appreciate it. Thanks in advanced.
 
Old 01-26-2005, 01:30 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
We're usually pretty friendly around here to answer your questions. As far as learning it, you should check here .
 
Old 01-26-2005, 01:34 PM   #3
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
Yeah, you have found the right place to ask questions from C++ or any other programming questions. Feel free to ask them, people are very willing to help here :-)
 
Old 01-26-2005, 01:42 PM   #4
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
like
Matir i would also use google to find C++ forums and tutorials and other stuff. However i perfer the google directory . Go to computers/programming/languages. this should have many C++ stuff in the C++ subsection but will also let you find stuff for other languages.

And always remeber that the proggramming forum is always open to help as stated above and also the new programmingquestions.org forum may help.

 
Old 01-26-2005, 08:59 PM   #5
Rubedogg
LQ Newbie
 
Registered: Nov 2004
Location: Bay Area, CA
Distribution: FC3, SUSE 9.1, Xandros, Mandrake 10.1, Slackware 10, and Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
moving to a on to next commands after if - else if statement

Like I mentioned, I am extremely new to C++. As part of the first assignment, we are suppossed to write a simple program about painting a wall.
My question is how do I move onto the next statement after the else if command. I remember in BASIC being able to make some kind of pointer.
Below is part of my program. I am not asking people to write the program for me, just help me get past this small step.


#include <iostream.h>
#include <stdlib.h>

int main ()
{
char Yes = 1;
char No = 0;
int answer;
cout << "Did you pick a wall? (Yes=1 or No=0)" << endl;
cin >> answer;
if (answer == 0)
{
cout << "Please pick a wall now.";
}
else if (answer == 1)
{cout << "Do you have the needed supplies? (Yes=1 or No=0)" << endl;
}
cin >> answer;
if (answer == 0)
{
cout << "Please buy the following: Plastic painting tarp, painter's tape, bucket/s of paint, wooden mix stick/s, brushes, rolling pan, and roller.";
}
else if (answer == 1)
{cout << "Did you empty the room of items? (Yes=1 or No=0)" << endl;
}
cin >> answer;


and so on.....
if I enter "2" for the answer no, it does give me the output, however it won't move onto the next part. Hopefully this makes sense.
Also I want to make sure its simple. If you have suggestions as a simpler way to do this, please let me know.
I may making this program harder than it needs to be. Thanks in advance.
 
Old 01-26-2005, 09:40 PM   #6
csfalcon
Member
 
Registered: Jun 2004
Location: MD
Distribution: Fedora Core
Posts: 269

Rep: Reputation: 31
Code:
if (..)
{
}
else if (...)
{
}
else
{
// this is where your statment after else if goes
}

Last edited by csfalcon; 01-26-2005 at 09:44 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning C J_K9 Programming 18 09-17-2005 01:17 PM
Need help learning C++ Vodius Programming 8 05-16-2005 07:44 PM
Learning Perl - Got a Question g2axiom Programming 2 01-17-2005 01:26 PM
Quick question: Learning commands Kami.JZ Linux - Newbie 4 10-24-2004 04:14 PM
Learning C/C++ Debian-Gnu-B Linux - Software 12 01-28-2004 03:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration