0
#include "cdebug.h"
#include "stdlib.h"
int main()
{
char *cbloc = (char *)malloc(sizeof(char) * 40);
memset(cbloc, 40, sizeof(char) * 40);
DFORC(cbloc, 0, sizeof(char) * 40);
system("PAUSE");
}
下面無效的類型參數是我調試的指針指針錯誤。的一元*
#ifndef _CDEBUG_H_
#define _CDEBUG_H_
#include "stdio.h"
int counter;
//Debugging functions written by skrillac
//constants
#define NEWLN() printf("\n");
#define DFORC(ptr, offset, len) for (counter = offset; counter < len+offset; counter++)printf("'%c', ", *ptr[counter]);
#define DFORI(ptr, offset, len) for (counter = offset; counter < len+offset; counter++)printf("'%i', ", *ptr[counter]);
#define DFORV(ptr, offset, len) for (counter = offset; counter < len+offset; counter++)printf("%x, ", *ptr[counter]);
#endif
的誤差在DFORC()宏某處發生寫頭。我想我的問題是在哪裏,我該如何解決它?