Trying to use a makro in C

Just trying to use a simple makro which reserves memory for a 2D array and initialize every the whole array with one value, but the gcc throws this error :

2DMakro.c:39:5: error: expected expression
ALLOC_ARRAY2D(array, int, dim1Makro, dim2Makro, initMakro);

#include <stdio.h>
#include <stdlib.h>

ARRAY = (TYPE**) malloc(DIM1*sizeof(TYPE));
for(int zeile = 0; zeile < DIM1; zeile++) {        
for(int a = 0; a < DIM1;a++){
for(int b = 0; b < DIM2; b++){
    ARRAY[a][b] = INIT;

(for int zeile = 0; zeile < DIM1 ; zeile++) {
for(int spalte = 0; spalte < DIM2 ; spalte++){
//Gibt Speicherplatz frei   

main(int argc, char *argv[]) {
char *type,*dim1,*dim2,*init;
char* dim1P, dim2P,initMakroP;
int dim1Makro, dim2Makro, initMakro;

//char zu integer konvertieren
dim1Makro = atoi(argv[1]);
dim2Makro = atoi(argv[2]);
initMakro = atoi(argv[3]);

ALLOC_ARRAY2D(array, double, dim1Makro, dim2Makro, initMakro);
return 0;

Well and this is my .c file, any suggestions what I did wrong?
Thanks in advance.

Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.