ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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 :-)
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.