Hi!
I'm currently working on a small program that prints records
of a database.
However during compilation I'm getting an error: "Incompatib le types in assignment".
I'm al ittle bit stuck for the moment. If anyone could help me out that would be great!!
Thanks in Advance!!
The small program is as following:
I'm currently working on a small program that prints records
of a database.
However during compilation I'm getting an error: "Incompatib le types in assignment".
I'm al ittle bit stuck for the moment. If anyone could help me out that would be great!!
Thanks in Advance!!
The small program is as following:
Code:
#include <stdio.h>
#include <string.h>
typedef struct record {
char Naam[25];
char Adres[25];
int Tel[10];
}Record;
struct database{
Record record1 ;
Record record2;
Record record3;
Record record4;
Record record5;
} db0;
void Print (Record *data);
main (void)
{
/*Statische initialisatie van database */
db0.record1.Naam = "Peeters";/* here i get the error!!*/
db0.record1.Adres = "Langendries 5"; /*and here*/
db0.record1.Tel = 25428956;/*and here*/
db0.record2.Naam = "Van Damme";/*and here*/
db0.record2.Adres = "Poststraat 9";/*and here*/
db0.record2.Tel = 56898569 ;/*and here*/
db0.record3.Naam = "Martens";/*and here*/
db0.record3.Adres = "Akkerstraat 56";/*and here*/
db0.record3.Tel = 5689745 ;/*and here*/
db0.record4.Naam = "Neeskens";/*and here*/
db0.record4.Adres = "Azalealaan 12";/*and here*/
db0.record4.Tel = 168235689 ;/*and here*/
db0.record5.Naam = "Goovaerts";/*and here*/
db0.record5.Adres = "Dorpstraat 4";/*and here*/
db0.record5.Tel = 165894556 ;/*and here*/
DrukAf(&db0.record1);
DrukAf(&db0.record2);
DrukAf(&db0.record3);
DrukAf(&db0.record4);
DrukAf(&db0.record5);
for(;;){};
}
void Print (Record *data) {
printf("Naam: %25s \n",data->Naam);
printf("Adres: %25s \n",data->Adres);
printf("Telefoonnummer: %10d \n",&data->Tel);
}
Comment