Reputation: 4713
In python i will do like
grid = [['a','b','c'],['d','e','f'],['g','h','i']]
another_grid = [['a','a','a'],['d','e','f'],['g','h','i']]
another_grid[0][1] = grid[1][1]
Above code will change 'a' to 'e'. How to do this in c ?
Upvotes: 0
Views: 241
Reputation:
It's the same, even the syntax is similar:
char grid[3][3] = { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
char another[3][3] = { { 'a', 'a', 'a' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
another[0][1] = grid[1][1];
Upvotes: 1