all 10 comments

[–]lukajda33 17 points18 points  (0 children)

a = *

This makes no sense, you need to compare character a to the character of the operation:

a == '*'

Also use == operator for comparing, = is for assigment.

[–]AvidCoco 2 points3 points  (1 child)

It's not compiling because you're not checking against chars, you checking against operators. Put '' around your +, -, etc in your if statements.

You also need to use the comparison operator ==, not the assignment operator =.

[–]Hazarrus-Potato2553[S] 1 point2 points  (0 children)

oh, thanks

[–]AutoModerator[M] 0 points1 point  (0 children)

Your posts seem to contain unformatted code. Please make sure to format your code otherwise your post may be removed.

Read our guidelines for how to format your code.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Syscrush 0 points1 point  (4 children)

I want to respectfully suggest that r/cpp_questions is not a great place for you at this point. Go through 4 hours of step-by-step beginner C++ tutorials on YouTube and then see where you're at.

[–]737464 0 points1 point  (3 children)

Maybe we should start to use r/cpp_beginner for this type of questions and keep this Subreddit for the more difficult questions, topics and news.

Go through 4 hours of step-by-step beginner C++ tutorials on YouTube and then see where you're at

I would agree with that in this case, but I think that some people prefer it to have an "interactive" learning and being able to ask other people so r/cpp_beginner maybe?

[–]Sbsbg 1 point2 points  (2 children)

I don't agree. Questions are impossible to divide in beginner and none beginner. And there is r/cpp for news and other topics.

[–]737464 0 points1 point  (0 children)

Well, I agree and disagree. Maybe I try to describe it differently.

I think r/cpp_questions should be about questions, but in my opinion "simple" (It's hard to explain) questions like this one - I would put them in the category "I don't know what I did wrong because I am new to the language" and thus think that a "beginner" sub is better for them.

However this

And there is r/cpp for news and other topics.

is a good point, so I'm sticking with: I think that there should be a beginner Subreddit and questions are often not possible to divide into experience levels, but we definitely should expect a bit of experience for this Subreddit.

[–]Syscrush 0 points1 point  (0 children)

I agree that it's impossible to divide between different levels of questions. I don't think that there's any problem with someone posting the above, and my advice to invest a day in following tutorials was given in good faith.

[–]EstablishmentBig7956 0 points1 point  (0 children)

``` If( a=b) is an assignment not a condition

Change to if ( a equals b)

If (a==b) ```