All Questions
28 questions
0
votes
1
answer
113
views
Serialise a struct containing a flexible array
I want to serialise and deserialise a struct containing a flexible array.
I did find a working code but wondering if it is the most elegant and optimum way to do it.
This is my first attempt below ...
0
votes
2
answers
1k
views
Why I cant get sizeof a pointer Array
well I am trying to get array size to convert hex value to int value. but if I try to get size of array it returns every time 2. Actually .I dont understand. how to get array size, can you help me?
...
0
votes
2
answers
1k
views
Passing a two dimensional array to a function
I'm working on an led matrix project where I'm running a series of patterns made of bitmap frames.
Here's an example: https://vimeo.com/564184465
Right now I'm using a series of method calls named per ...
1
vote
1
answer
967
views
Can you create an array for functions? [closed]
Let's say I want to create 10 functions, named Function1, Function2 until 10. Each function is used if a certain variable is equal to its number. Rather than using individual functions, I was ...
0
votes
1
answer
636
views
esp32 crashes when trying to dereference a pointer value
I have a websocket listener that is giving me a std::string of my message payload (I want the bytes) and I wrote a function that pulls each of the bytes out and puts them into 32 bit integer variables,...
0
votes
1
answer
2k
views
Setting an array pointer to null on declaration
How can I set an array pointer to null?
I have a pointer to a 3 int array that I am trying to set to null.
int (*EXCLUSIVE_COLOR)[3];
Per this link I was trying to set it to null upon ...
0
votes
1
answer
218
views
Assigning an empty array row to reference [duplicate]
int colors[][3] = {
{ 255, 0, 0 },
{ 0, 255, 0 },
{ 0, 0, 255 },
{ 253, 7, 210 }
};
int (*EXCLUSIVE_COLOR)[3];
I have a two-dimensional array to store some color values.
I have a 2nd array,...
0
votes
1
answer
471
views
Error taking address of temporary array when passing compound literal array
I have an Arduino sketch that passes an array into a method as a compound literal, but for some reason I keep getting the following error:
void setup() { }
void printConcatLine(char chunks[][20]) { }
...
0
votes
1
answer
1k
views
Swap two arrays (using pointers, not copy)
I've got two arrays, defined as:
uint8_t array1[10];
uint8_t array2[10];
I'd like to swap the arrays (actually the pointers to each array) using code like this:
uint8_t *tmp = array1;
array1 = ...
0
votes
2
answers
228
views
An array of existing arrays
I have a bunch of 3D arrays in the following form:
byte lines[][4][2] {
{ {B00000000, B11110000 },
{B00000000, B11110000 },
{...
0
votes
1
answer
451
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 ...
0
votes
1
answer
273
views
Parsing array of an object in a library constructor
I am trying to develop an Arduino library that consists out of two classes. I want 'WayPointStack' to store an array of 'WPCommand', but I can't get it to work.
WayPointStack.h
#ifndef ...
0
votes
1
answer
2k
views
Passing arrays, global arrays within functions, pointers, and declaring array sizes
I'm super confused right about now!
I've been working on project involving Xbees in API mode, and I need to send different arrays of bytes to the Xbee depending on which buttons I press. Mostly what ...
1
vote
2
answers
853
views
Creating an array of structures which store bitmaps to work with u8glib
I've tried reading the documentations and I'm getting desperate because I can't find anything.
I need to create an array of structures, which contains a bitmap stored in PROGMEM space (because of ...
2
votes
1
answer
83
views
Dynamic allocation/ Pointer to Pointer to update an Array containing parameter [closed]
topicArray defined as follows:
const char* msgTopic = "Home/Messages";
const char* groupTopic = "Home/All";
char* deviceName = deviceTopic;
const char* topicArry[2] = {deviceTopic, groupTopic};
But ...