#What is the difference between member function and main function???

17 messages · Page 1 of 1 (latest)

bold moss
#

This doesn't make sense

narrow sparrowBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

bold moss
#

Ok what is the difference between a void header function in a struct and just a void function in the main.cpp?
This works ```#include "Simple.h"
#include <iostream>
#include <thread>
#include <vector>
#include <functional>
#define MAX 1;
void Foo(int num)
{
std::cout << num << '\n';
}
int main()
{
simplebot bot;
bool running;
LPMSG msg;
int MAXLENG = 30;
std::vector<std::function<void()>> mem;
mem.push_back(std::bind(Foo, 1));

#include "Simple.h"
#include <iostream>
#include <thread>
#include <vector>
#include <functional>
#define MAX 1;
void Foo(int num)
{
std::cout << num << '\n';
}
int main()
{
simplebot bot;
bool running;
LPMSG msg;
int MAXLENG = 30;
std::vector<std::function<void()>> mem;
mem.push_back(std::bind(bot.LClick, 1));```
But not this???

#

But i included it thru a header

#

and i instanced the structure

mighty mason
#

class methods that look like they take no argument actually always take the 'this' ptr as an argument, so they're not equivalent to a function with void() signature

rugged pagoda
bold moss
#

Do i have to deref it some how?

mighty mason
bold moss
#

Oof unfortunately not

viscid jacinth
#

Top 10 most genius questions

#

A main function and member function isnt different when being compiles

#

but when using the programming language, member functins are kindof like folders

#

u have have folders and subfolders for functions

#

in ur case ur refering to them as members

narrow sparrowBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.