:
#define LC_ERR_LEN 300
typedef struct dLC_ERRMSG {
short nr;
short strategy;
char tx[LC_ERR_LEN];
} LC_ERRMSG;
#include "structs.hpp"
LC_ERRMSG err;
int main()
{
char *szError;
szError = strerror(sStatus);
snprintf(err.tx, LC_ERR_LEN, "%s - %s", szFilename, szError);
}
. , main.cpp :
extern LC_ERRMSG err;
, err . , :
#include "structs.hpp"
LC_ERRMSG err;
globals.o main.o.
. , , LC_ERR_LEN , globals.cpp , main.cpp. , , szFilename szError NULL/bad. printf NULL %s; :
#include <stdio.h>
int main()
{
printf("%s\n", NULL);
}
EDIT: . , C, err - , . ++, , err . , ++.