Assigning Values to an Array: Difference between revisions

m
→‎{{header|C}}: +lang tag, - c++ style comment, +header, -work with gcc
m (→‎{{header|C}}: +lang tag, - c++ style comment, +header, -work with gcc)
Line 73:
 
=={{header|C}}==
<lang c> #include <sys/types.h>
{{works with|gcc| 4.1.1}}
int writeToIntArray(int *array, size_t array_sz, int loc, int val)
{
//* Check bounds on array */
if (loc > array_sz || loc < 0)
return -1;
array[loc] = val;
return 0;
}</lang>
 
=={{header|C sharp|C #}}==