Anonymous user
Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 20:58, 8 October 2008
, 15 years agono edit summary
m (→[[Two-dimensional array||ALGOL 68]]: fix spelling) |
No edit summary |
||
Line 44:
PRINT array(1,1)
ERASE array
=={{header|C}}==
<C>
#include <stdio.h>
int main(int argc, char **argv) {
int user1 = 0, user2 = 0;
printf("Enter two integers. Space delimited, please: ");
scanf("%d %d",&user1, &user2);
int array[user1][user2];
array[user1][user2] = user1 + user2;
printf("array[%d][%d] is %d\n",user1,user2,array[user1][user2]);
return 0;
}
</C>
=={{header|C++}}==
|