Header file is name myh.h. In this program how to store more #define value as p[] in this array? Two values are stored and how to access these values in main function where the comment is given? There is compilation error in the program.
#include <stdio.h>
#include <string.h>
#define p [] { "parthinb ", "baraiyab " }
#define u "parthin"
int account(char name[10])
{
printf("Welcome %s", name);
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include "myh.h"
int main()
{
char un[20], pass[10], c;
int i;
start:
printf("Enter USER NAME::");
gets(un);
printf("Enter Password of 8 Digitis::");
for (i = 0; i < 8; i++)
{
c = getch();
pass[i] = c;
c = '*';
printf("%c", c);
}
pass[i] = ' ';
if (strcmp(un, u) == 0)
{
if (strcmp(pass, p[]) == 0)
{
printf("\nCORRECT\n");
account(un);
}
else
{
printf("\nPassword mis-match\n");
goto start;
}
}
else
{
printf("\nUSER Name or password does not match.\n");
goto start;
}
}