#include #include #define p printf#define S scanfstruct person char name<20>; int age; char relationship<200>;int main(){ document *storage; int a, b, c; char ch; char password <20>; char passwordinput <20>; P("Welcome come Recentive customer Database managing 1.0.\n"); P("Do not use spaces in any data entries, and substitute through underscores to avoid the event of regimen errors.\n"); P("Please input her password.\n"); strcpy(password, "clevel"); S("%s", &passwordinput); c = strcmp(password, passwordinput); if(c == 0) P("Access granted.\n"); rather P("Access denied.\n"); return 0; label: P("Type among the complying with integers to carry out a certain action:\n1- add brand-new client\n2- accessibility database customer list\n3- clean storage record contents\n4- start emergency data protection\n5- terminate database operation\n"); S("%d", &a); if(a == 1) P("Add brand-new client.\n"); struct person client1; P("Enter client name:\n"); S("%s", &client1.name); P("Enter customer age:\n"); S("%d", &client1.age); P("Enter client relationship come the company:\n"); S("%s", &client1.relationship); warehouse = fopen("storage.txt", "a"); fprintf(storage,"\n%s\t%d\t%s",client1.name, client1.age, client1.relationship); fclose(storage); P("Client has been added.\n"); goto label; rather if(a == 2) { P("Access database clients.\n"); warehouse = fopen("storage.txt", "r"); while((ch = fgetc(storage)) != EOF) P("%c",ch); fclose(storage); P("\n"); P("Press any type of number vital to walk to main menu\n"); S("%s",&b); if(b > 0 || b 100 || b


You are watching: Error: two or more data types in declaration specifiers

*

anduril462
*

Registered User Join day Nov 2010Location long Beach, CAPosts 5,909
Always compile through the warning level collection to max (e.g. -Wall flag because that gcc, else review your compiler documentation). You need to see other like:
$ make foogcc -Wall -ggdb3 -pedantic -std=gnu99 -O0 -o foo foo.c -lm -lpthread -lrtfoo.c:14:1: error: meant ‘;’, i would or ‘(’ prior to ‘int’foo.c: In function ‘main’:foo.c:25:5: warning: layout ‘%s’ expects debate of form ‘char *’, but argument 2 has kind ‘char (*)<20>’ <-Wformat>foo.c:44:9: warning: style ‘%s’ expects debate of kind ‘char *’, but argument 2 has kind ‘char (*)<20>’ <-Wformat>foo.c:48:9: warning: layout ‘%s’ expects debate of kind ‘char *’, but argument 2 has kind ‘char (*)<200>’ <-Wformat>foo.c:64:9: warning: format ‘%s’ expects discussion of type ‘char *’, however argument 2 has type ‘int *’ <-Wformat>make: *** Error 1


See more: How To Know If A Guy Likes You In Middle School ? (For Middle School Girls)

Line 14: struct meanings require a ; to end them, therefore the Compiler doesn"t think you"re done, and also isn"t expecting a function definition like main.Lines 25, 44, 48: scanf calls for a tip to where it will save the scanned data. The surname of an array, without any indexing < > brackets, is a tip to the an initial element. Thus, girlfriend don"t require the & because that parameters because that the %s layout specifier.Line 64: You have to use a different format specifier to review ints with scanf. I suggest you review a textbook/tutorial or the scanf documentation.Other notes:Defining printf together P and also scanf as S is a negative idea. Every it walk is minimize readability. Clear, readable password is paramount and also you must never sacrifice clarity or readability since you"re also lazy to type a couple of extra characters.Some of your variable names could be better. In particular, a, b and c. Again, don"t sacrifice clarity. Because that example, a should more than likely be called something favor menu_choice. C is not required (you have the right to put the strcmp speak to directly in the if condition), yet if you desire to usage it, a name choose password_compare would be better.Read up on fgetc. It return an int, no a char. Therefore you should declare ch as an int. This is for this reason fgetc have the right to return every possible char value, and special values choose EOF.Always check return worths of fopen before proceeding. If fopen fails, your paper pointer is NULL, and also trying to do something v it (e.g. Fgetc, fclose) will certainly attempt to access data in ~ the NULL address, which outcomes in undefined behavior (anything or nothing deserve to happen). In your details cases, it will likely an outcome in a regime crash because of seg fault.There"s probably more, however that have to keep you busy for a while.