cscanf; I did everything well, but I get a c6328 error.

Asked 1 years ago, Updated 1 years ago, 329 views

I'm a beginner who just started learning coding. After the first class, I got confused during the assignment, so I'm leaving a question like this.

#include <stdio.h>
int main(void)
{
char str[300];
    printf("enter your password: ");
    scanf_s("%s", str, sizeof(str));
    printf("your password:  %s\n", str);

return o;
}

There seems to be no problem, but the green wave of the error mark keeps popping up on the scanf side.

And from the list below --> *C6328 size mismatch: 'unsigned_int64' passed to _Param(3) 'unsigned int' is required for the next call. 'scanf_s'. **

The phrase keeps popping up. And the debugs keep failing.

Is there any solution?

c

2022-10-30 00:00

1 Answers

The long character output range must be [256].

If you just fix this...

char str[256];
printf("enter your password: ");
scanf_s("%s", str, sizeof(str));
printf("your password:  %s\n", str);

It runs well.


2022-10-30 00:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.