开发者

How can I write an Array in size of char-Pointer in C language [closed]

开发者 https://www.devze.com 2022-12-07 18:03 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

开发者_StackOverflow中文版

Closed 1 hour ago.

Improve this question

I want to get the output like this. The Output is alway like String but it is the result of the Characters. The even Numbers staying like 0 and not changed but the odd Numbers are '+' or '-' and the results are alwas as a chanin Numbers. It can also be Negative Number.Like examples.

How can I write an Array in size of char-Pointer in C language [closed]

I have tried to use calloc and malloc but I don't know how to write it correctly.

2 # include < stdio .h > // fuer printf () 3 # include < stdlib .h > // fuer free 4 5 char * preccalc { char * term [] , int size ); // Description of the Funktion 6 7 int main (int carg , const char ** varg ){ 8 if (( carg ==0)||( carg % 2 != 0)) // even Parameter Number >0 ? 9 return -1; // ( Parameter started with program names ) 10 char * result = preccalc (& varg [1] , carg -1); 11 printf (" Ergebnis :"% s ".\ n",result ); // output 12 free ( result ); 13 return 0; // 0 means it is okay 14 } 15 16 // Ihr Code aus calc.c ab hier

0

精彩评论

暂无评论...
验证码 换一张
取 消