All Questions
16 questions
3
votes
2
answers
1k
views
Call a C++ class method without a class instance?
Long story short, I am trying to build a wrapper to access C++ source code from a C main function (I have to do the conversion because of Embedded systems); however, I am having trouble calling the ...
0
votes
2
answers
151
views
Pointer to a class method call
I am trying to define a class named RationalNumber. In the constructor I want to simplify the fraction represented by the RationalNumber using a callback function to another function (named ...
0
votes
2
answers
81
views
Pass function call from a class to one of its members based on another member parameter
Assume I have the following class A which is passed around through different function calls and wrappers.
class A{
std::vector<int> a;
public:
int getSize const {return a.size();}
int getVal(...
-2
votes
1
answer
62
views
For Loop Method Call
An error pops up saying the class type does not provide a subscript operator.
I'm new to c++ and can't seem to figure this one out. Would be really thankful if you provided me some tips and where I'm ...
-2
votes
1
answer
2k
views
QT call function from another .cpp file c++
I'm currently working on my first GUI cpp application using QT. Right now my aim is to display a dialogue to the user with two buttons: Ok and Cancel. I've used signal and slot editor to make cancel ...
1
vote
3
answers
77
views
how to call a function from a different class in c++?
i've got two classes, Apple and Banana. i want to change the value of iTestA (class Apple) in the class Banana with the function callItestA.
i tried using pointers but it didn't seem to work (the ...
0
votes
3
answers
82
views
"Pass" function call from class to class, C++
Is there a way to pass a function call from class to class?
For example:
//foo.cpp
foo::foo
{
...
myfoo2 = new foo2();
...
}
//foo2.h
class foo2
{
...
public:
void method1();
void ...
-5
votes
1
answer
52
views
class->methode1()->methode2() what does it mean? [closed]
Im introducing myself to QT right now and often comming across calls like class->methode1()->methode2(). What does this mean? methode1() would be a methode of class, but what about methode2() ...
-2
votes
2
answers
88
views
How to call function from class to main?
I need conj for complex number.
For example complex number X.
I wrote this code, but i dont know how to call it in main.
Kompleks operator ~() const {
return Kompleks(Re() , -Im());
}
-2
votes
2
answers
2k
views
c++ call outside class functions
Is there an way for an Inside class to call the Outside class functions directly?
Instead of having to check if a boolean is true or not.
Like this:
Inside Class
class Inside {
public:
Inside()...
0
votes
2
answers
747
views
Get arrays from other classes
I am working on a Ludum Dare project and I can't figure out how to use an array in another class for using a tilesheet. What is the best way to store an array in another class and then use it in the ...
-2
votes
1
answer
187
views
Call Array 2D From Another Method Same Class - C++
I Have Code:
#include <iostream>
using namespace std;
class tokoKomputer
{
public:
void notebook();
void printNotebook();
};
void tokoKomputer::notebook()
{
...
-1
votes
1
answer
137
views
Using a function that is inside a class
I have a class that contains a function right before the contstructor, that itself is empty, and that's all, so my class contains the function only and some not so important elements.
How can I call ...
0
votes
1
answer
365
views
error: no matching function for call to , using C++
I am new to C++, Please if anyone could provide guidance/insight into these errors. It would be of great help.
The following code fuzzyex1.cpp:
#include "fuzzyvar.h"
TControlVariable TEMPERATURE(0,1,...
-1
votes
1
answer
1k
views
Visual C++ call method from other class
There is class Road with its Road.h and Road.cpp which contains implementation of method isInside(int x, int y) and the road rectangle sizes. And there is class Car with its .h and .cpp and it ...