thanks for ur help
i fixed some problems and this program below it seems to be working ok but i have one problem. when it goes through the function "showD" to display the value of the variable,the value doesn't go with it
it can show the value in the main but not outside
how can i solve this problem?
thanks
Code:
include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include <math.h>
struct Manufacturer
{
char manuindex[100][62], code[6],name[16], address[21],contact[11];
int i;
//bool pass;
};
void showD(char test[]);
int main()
{
char tt[62];
struct Manufacturer m;
m.i=0;
puts("Enter code"); //
gets(m.code);
//fflush(stdin);
while (strlen(m.code)>0)
{
puts("Enter name:");
gets(m.name);
puts("Enter address");
gets(m.address);
puts("Enter Contact");
gets(m.contact);
strcpy(tt,m.code);
strcat(tt,m.name);
strcat(tt,m.address);
strcat(tt,m.contact);
strcpy(m.manuindex[m.i],tt);
puts("Enter code:");
gets(m.code);
m.i=m.i+1;
}
showD(m.manuindex);
//puts(m.manuindex[0]);
//printf("%s",m.manuindex[0]); // just checking data
return(0);
}
/////*************Function***************////
void showD(char test[])
{
// struct Manufacturer mn;
//puts(test[0]);
printf("%s",test[0]);
}