I wished to make a code in C++ that uses arrays of strings and works like a Login Authenticator.
In the process, I decided to get the multidimensional (3 or more dim.) string array idea cleared up. It accepted data and displayed prety well for the string :
char unpw [10][2][8]
So all I am trying to do is minimize it to a single username + password array, but can't get past the following piece, please help :-
#include <stdio.h>
#include <conio.h>
void main()
{
/*char unpw [10][2][8];
int i;
printf("Please enter the usernames and respective passwords (total=5)\n");
for (i=1;i<=5;i++)
{
scanf("%s",&unpw[i][0][i]);
scanf("%s\n",&unpw[i][1][i]);
}
i=1;
for (i=1;i<=5;i++)
{
printf("%s\n",&unpw[i][0][i]);
printf("%s\n \n",&unpw[i][1][i]);
} */ // Works pretty well till here
int i=1;
char eunpw[10][2][1];
printf("Please enter the username and password to verify your account \n");
scanf("%s %s",eunpw[1][1][1],eunpw[1][2][1]);
printf("%s\n",eunpw[1][1][1]); //trying to verify it :-(
printf("%s\n \n",eunpw[1][2][1]);
getch();
}

New Topic/Question
Reply




MultiQuote





|