Exception thrown at 0x7B091F4C (ucrtbased.dll) in ICP LAB ASSIGNMENT PROJECT.exe: 0xC0000005: Access violation reading location 0x00000038. occurred

0

Idk why but errored appear again after someone fixed it for me. Previously I was trying to print ID and it worked, but now I'm trying to print "pass" which again leads me to error.

I put the * to declare that it's a string.

I put " " instead of ' ' which I've done in my previous one.

int main()
{
    int i;
    char* id[8], pass[8]; ///sample data wanted to print
    id[0] = "id1";
    id[1] = "id2";
    id[2] = "id3";
    pass[0] = "pass1";
    pass[1] = "pass2";
    pass[2] = "pass3";
    for (i = 0; i < 3; ++i)
     {
        printf("%s\n", pass[i]);
     }
}
c
asked on Stack Overflow May 5, 2020 by Lorale

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0