Mail Archives: djgpp/1997/08/21/06:49:57
Gal wrote:
>
> Okay here I start:
>
> // defining types variables
> struct IndexFileName {
> char FileName[12];
> }
>
> int IndexFileName;
>
> // our function
> int compare (char *FileName)
> {
> return strcmp(Index.FileName, FileName);
> }
>
> //main
> void main ()
FYI: int main(void)
> {
> printf("%d\n", compare("TEST.TST"));
you did not include <stdio.h> for printf.
> return 0;
> }
<NOT A FLAME: HONEST OPINION>
comp.os.msdos.djgpp is not a forum to discuss basic C/C++ issues. you
are better of posting to more relevant groups such as: comp.lang.c,
comp.lang.c++ and their moderated counterparts.
</END NOT A FLAME>
that said, do you not read what the compiler tells you:
C:\djgpp\c>gcc sss.c -o sss.exe
sss.c:5: two or more data types in declaration of `IndexFileName'
sss.c: In function `compare':
sss.c:10: `Index' undeclared (first use this function)
sss.c:10: (Each undeclared identifier is reported only once
sss.c:10: for each function it appears in.)
-- Sinan
- Raw text -