Questions tagged [typedef]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
64 views

Typedef struct not working

I made this simple code but I'm getting the following error exit status 1 'RGB' does not name a type typedef struct RGB { double r; double g; double b; }; RGB led; RGB func(...
0
votes
1answer
77 views

typedef function pointer array declaration problem

Thanks for all your feedback. It helped. I rewrote this yet another time and this time it works perfectly. I included three variations: a simple example using an array of function pointers, a Lambda ...
1
vote
2answers
131 views

How do I implement reverse enumeration?

Basically I'm trying to output a string based upon a value in an array, the following code is what I have come up with to achieve my desired result, but I have a feeling that there is a better way to ...
1
vote
0answers
81 views

Using pointer to a Global function

I am trying to store and use a pointer to a global function. The function global_f returns a String and takes an object as parameter: String global_f(Request r){ // ... return "This is it"; } ...
0
votes
1answer
1k views

Typedef not accepted as a data type in a function?

I know I'm in a C++ compiler, but I typically create a typedef from structures, probably a holdover from earlier C programming. So this has my head spinning. I create a Typedef from a structure. After ...
1
vote
2answers
32 views

Comparing custom variable type definitions

In a library I am using with an OBD adapter, they define a public function to get the state of the OBD connection using some strange (and, in my opinion, useless) custom defined variable type: // ...
3
votes
3answers
1k views

How to correctly use functions that return pointers to multiple typedef'ed types in Arduino IDE?

I have a program that typedef's two structs. Each one has a corresponding function that returns a pointer to it.... typedef struct { int x1; } x; x *a; x *f(void) { return a; } typedef ...