Questions tagged [typedef]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers

Own type definition using a struct does not name a type

I need to initialize several buttons and LEDs connected to my Arduino. To store data related to an individual button or LED, I decided to define my own data type using two different structs. One for a ...
  • 205
1 vote
2 answers

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
1 answer

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 ...
  • 131
1 vote
2 answers

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 ...
  • 11
2 votes
0 answers

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"; } ...
1 vote
1 answer

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 ...
  • 331
1 vote
2 answers

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
3 answers

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 ...
  • 1,460