I need some cue

I am completely new to c++, I need some cue here. How to structure a layout, for example in HTML: we use html to structure a page, css for decoration, javascript to program it. How do you stucture a layout for c++?. Thanks in advance.
Neither in C++ nor in other programming languages do you have a layout.
A simple boilerplate for your code to start:
1
2
3
4
5
6
7
#include <iostream>

int main()
{
   // put your code here
   return 0;
}
Thanks for reply. But how do you create user interface in c++?, I have codeblock 16.01.
Last edited on
Basically you can have a console interface or a GUI. A GUI is sth. with buttons, textboxes, images, etc.. http://pasteboard.co/NeBaKOqYE.jpg
For beginners it's easier to start with console apps.
Output is done with cout and input with cin or getline.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <string>

using namespace std;

int main()
{
   string name;
   cout << "Enter your name: "; 
   getline(cin, name);
   cout << "Hello " << name << "\n\n";
   return 0;
}


If you rather would like to learn GUI apps consider learning Java or C#. They are much easier.
Its not that bad, but its not simple either.

A gui in windows visual studio, for example, there is a what-you-see-is-what-you-get "form" editor where you can drop, for example, a button and an edit box on the window and connect them. But it takes knowing the c++ language AND the windows libraries to do that. Unix uses different libraries, and there are cross platform tools like QT which is clunky but it gets the job done. Each of these is a third party set of tools that sit "on top of " or "outside" the language proper; learning them is necessary to make gui programs but they are not C++ itself, just like using someone else's menu program in a web page isn't pure coding but using a "library".

Its a pretty steep learning curve. C++ itself is a large, rich, and powerful language and with that comes a large amount of things to learn. Then learning the gui stuff after that will take a bit more.

I highly recommend you learn basic c++ for a few months first. But if you are in a hurry, you can either try to do windows on the fly, or maybe check out some very simple intro level QT programs and try to use that system. Windows, I highly recommend you swap out for the free visual studio home version. Its possible to write windows code out of visual, but microsoft's libraries on microsoft's compiler work very clean together.


Thanks for advice.
Topic archived. No new replies allowed.