Use another language to call a function: Difference between revisions
Content deleted Content added
→{{header|C}}: Delete redundant code. Add link to comment. |
|||
Line 85: | Line 85: | ||
=={{header|C}}== |
=={{header|C}}== |
||
This is a restatement of the problem, it is not a solution. Please remove it. |
|||
<lang c>#include <stdio.h> |
|||
extern int Query (char * Data, size_t * Length); |
|||
int main (int argc, char * argv []) |
|||
{ |
|||
char Buffer [1024]; |
|||
unsigned Size = sizeof (Buffer); |
|||
if (0 == Query (Buffer, &Size)) |
|||
{ |
|||
printf ("failed to call Query\n"); |
|||
} |
|||
else |
|||
{ |
|||
char * Ptr = Buffer; |
|||
while (Size-- > 0) putchar (*Ptr++); |
|||
putchar ('\n'); |
|||
} |
|||
}</lang> |
|||
I rewrote the driver as |
I rewrote the driver as |
||
<lang c>#if 0 |
<lang c>#if 0 |
||
I rewrote the driver according to good sense, my style, |
I rewrote the driver according to good sense, my style, |
||
and discussion |
and discussion <http://xrl.us/bmxxhb>. |
||
This is file main.c on Autumn 2012 ubuntu linux release. |
This is file main.c on Autumn 2012 ubuntu linux release. |