Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct{
- int x;
- int y;
- }point_t;
- int main(){
- int width = 5;
- int height = 4;
- /* velikost 2D pole */
- int size = width * height;
- /* 1D pole o velikosti 2D pole a vynuluju */
- point_t array[size];
- memset(&array, 0, sizeof(SIZE_OF_MATRIX));
- /* pristupujeme k prvku na radku X a ve sloupci Y pristupujeme stylem:
- * array[ width * X + Y]; indexujem od nuly */
- }
Add Comment
Please, Sign In to add comment