Answer the question
In order to leave comments, you need to log in
Transferring data as a separate block?
I need to pass some block of data to another function at once.
The main problem is not to use a struct or a class. Since the transfer occurs in only one fragment of a huge code, you don’t want to pile up something from this.
I wanted to resort to a lambda, but I never found a way to pull values when passing a pointer.
Passing values not in a block, but in parts is also not suitable, since it is likely that there will be more and more variables in the future.
Example : pass variables A, B, C, D of different types once to function F for data processing
Task : do not use structures and classes, be able to process all values.
Recently in some code I saw a similar structure - func( {int A, int B}, float C).
Answer the question
In order to leave comments, you need to log in
The main problem is not to use a struct or a class. Since the transfer occurs in only one fragment of a huge code, you don’t want to pile up something from this.
variables in the future will become more and more.
You can use char*
typedef char* pbyte;
func(pbyte pblock, int len); //len - длина данных
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question