how to generate code int16 foo(uint16 a,int16* b) prototype

15 ビュー (過去 30 日間)
vijaykumar mahajan
vijaykumar mahajan 2016 年 12 月 14 日
コメント済み: vijaykumar mahajan 2016 年 12 月 21 日
I need to implement int16 foo(uint16 a,int16* b) {a=&b;} in simulink. how to implement and generate the code as int16 foo(uint16 a,int16* b) {a=&b;}
  2 件のコメント
Guillaume
Guillaume 2016 年 12 月 14 日
int16 foo(uint16 a,int16* b) {a=&b;}
The function declaration looks like C code, but the function body is not valid (it does not assign anything to the return value) and is also pointless as it assign the address of pointer to a local variable that immediately goes out of scope. That's assuming you even can assign a pointer to an uint16 (which would require a 16-bit processor).
And is a really meant to be a pointer to a pointer to an int16?
vijaykumar mahajan
vijaykumar mahajan 2016 年 12 月 21 日
Thanks for your valuable answer,but how to generate code with prototype 'int16 foo(uint16 a,int16* b)' ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by