class of button

Thread Starter

skyr6546

Joined Mar 22, 2019
55
Hi, I'm sorry if this is a really elementary question. I'm completely new to C++ programming. I have idea in mind to make class of button. Each button has different colors , width, height and position

How to develop my idea into code
Code:
#include <iostream>
using namespace std;

class button
{
    private:
        char  colour[30];
        int   width;
        int   hight;
        int posiion;     
    public:     
}
int main()
{   
    return 0;
}
 

djsfantasi

Joined Apr 11, 2010
5,703
For what it is, this looks correct. Did you have a question?

I have a couple. Why did you choose class over typedef? Do you know the difference? Did you know that a class can contain other objects? Functions for example?

But most importantly, what are your questions and where do you want to go from here?
 

Thread Starter

skyr6546

Joined Mar 22, 2019
55
For what it is, this looks correct. Did you have a question?
But most importantly, what are your questions and where do you want to go from here?
Nothing specific I thought I should make class of button. I tried to implement idea in to c++ coding. I am not asking for code. I have a theoretical question How to make useful class for button's on the screen. What should be in main function
 

djsfantasi

Joined Apr 11, 2010
5,703
Nothing specific I thought I should make class of button. I tried to implement idea in to c++ coding. I am not asking for code. I have a theoretical question How to make useful class for button's on the screen. What should be in main function
I don’t know? What do you want to put in the main() function? That’s the heart of my last question.
 
Top