Loop problem C++

why woun’t this work

#include <iostream>
int main(){
  { ( ; ; )
int a = 1;
  a++;
  std::cout << a;  
}
  return 0;
}

I don’t understand what this is supposed to do. This not a loop format I am familiar with.


I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

hey sorry about that but i’m using C++ so that’s the loop im trying to use im sorry if this is not the way you format

Your code isn’t compiling, right? As @JeremyLT pointed out, this bit of code is nonsense:

{ ( ; ; )

Maybe you can explain to us what you are trying to do?

I write C and C++. That’s not a valid loop in either.

ok well i used it before and it had worked but, what I’m trying to do is make “a” add on to itself so i was trying to use said loop because that had worked before so i thought that it was a vailed loop

Whatever resource showed you that loop format, I’d get rid of it.

thank you my friend.

hey so im still learning to code a friend of mine had recomende C++ for what i’m trying to do but im new to code so i don’t know what im doing and i need some one to teach me os if you coul dhelp me find someone or some thing to teach me that would be grate

You can always ask more questions here as you have them!

just one thing i’ve been wondering can you make shapes or any visuals in C++ and if not is there a code layout that you sugjest for that?

I don’t do any work with graphical interfaces or display, so I don’t have any particular recommendations.

so i need to learn a new code set up?

I’m not sure what you are asking. I don’t do anything graphical with C/C++. Some people do, but I don’t know enough to recommend anything about that.

ok so what i was asking was can i make a gui using C++

Can you? Yes. Do I know anything about how to do that? No.

I would think a google search for “c++ gui libraries” would probably help you find what you are looking for.

Way back in my college days we used Motif to create c++ gui’s on unix systems. Now I’m really dating myself.

P.S. I’ll get you started with this:

What are the best cross-platform C++ GUI toolkits ?

is there one that i can download on chrome OS and also thank you for the help

Did you put this question into Google?

I ask because that’s all I can do to answer the question for you.

Sorry, I don’t know anything about Chrome OS. Here’s a link to get you started.

ChromeOS for developers