This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pass 1 dimensional array in function

Passing any arrays by value or pointer does not work very well.

I can try integrating an array into a structure, but that is not how I would do it.

if I have: frame( unsigned char &mbrtubuf, int &uslen) and the receiving side is :

frame ( unsigned char *somepointer, and int *uslen) neither of the variables are passed

correctly to the function. Prototype is in a header file. Does not work and when it does work

its becomes unstable. Terrible compiler. It should work and I should even have to think

about it. I spend more time on the Compiler then I do on the actual program.

The only way I can get the array into a fucntion is by declaring it external in the function.

Any ideas

Phil

Parents
  • It appears that across multiple files, one needs the keyword "extern" in from of the prototype

    No, one doesn't need that. If you think you do, either your reasoning is wrong, or you again failed to represent your actual problem in a useful manner.

    the variables become unstable.

    You're still making no sense at all. Either you're talking about prototypes, or you're talking about variables. Can't be both, because prototypes are for functions, not variables.

Reply
  • It appears that across multiple files, one needs the keyword "extern" in from of the prototype

    No, one doesn't need that. If you think you do, either your reasoning is wrong, or you again failed to represent your actual problem in a useful manner.

    the variables become unstable.

    You're still making no sense at all. Either you're talking about prototypes, or you're talking about variables. Can't be both, because prototypes are for functions, not variables.

Children
No data