Ok so I want to know if it's possible to make a method like this:
1 2 3 4 5
MyStruct *a()
{
//Edit Data in a.
return a;
}
Now it may seem like a dumb question but I'm unsure if this is possible. I know many other ways to do it. But is it possible to do it with no function arguments.
You cannot have input without function arguments (unless you use some kinda global variable). Closest you can get to that is a member function of MyStruct, in which case 'this' is the implicit argument
1 2 3 4 5 6 7 8 9 10
MyStruct* MyStruct::func()
{
// edit 'this'
returnthis;
}
// to call from code.
MyStruct* a = something;
a->func();