I have a problem in this code segment
printf("\nIn Func: %s", (*article[ctr]).artname);
I use Code:Blocks and get the error "undefined reference to WinMain@16", article is a pointer array shouldn't I access it just by dereferencing it? I also tried with -> but without success.
May I disobey something?
Thanks for help, I added the complete code below.
Header-File:
#ifndef _LAGER_H
#define _LAGER_H
#define MAXCHAR 40
#define lagerdateiname "lager.dat"
struct artikel_t
{
int artnr;
char artname[MAXCHAR];
float preis;
int bestand;
int min;
};
#endif
Code-File:
#include "lagdat.h"
#include <string.h>
#include <stdio.h>
int bestellMenge(struct artikel_t *article[], int len)
{
int errCode;
int retVal;
int ctr = 0;
struct artikel_t art;
unsigned int writtenArticles = 0;
unsigned int leftArticles = 0;
errCode = openLager();
if(!errCode)
{
int readOK;
while(!(readOK = readNext(&art)) && ctr < len)
{
if(art.bestand < art.min)
{
article[ctr] = &art;
ctr++;
writtenArticles++;
printf("\nIn Func: %s", (*article[ctr]).artname);
}
}
}
}