c6328, c4477 error

Asked 1 weeks ago, Updated 1 weeks ago, 2 views

#include <stdio.h>

int main_printfscanf(void)
{
        char name[256];
    printf ("What's your name?"");
    scanf_s("%s", name, sizeof(name));

    int age;
    printf ("How old are you?"");
    scanf_s("%d", &age);

    float weight;
    printf ("How much do you weigh?"");
    scanf_s("%f", &weight);

    double height;
    printf ("How tall are you?");
    scanf_s("%lf", &height);

    char what[256];
    printf ("What did you do wrong?"");
    scanf_s("%s", what, sizeof(what));

    //print the contents of the report

    printf("\n\n---Content of the report---\n\n");
        printf ("name: %s\n", name);
        printf("age: %d\n", age);
        printf ("Weight: %").2f\n", weight);
        printf ("Key: %).2lf\n", height);
        printf ("Crime: %s\n", what);

    return 0;
}

I am learning C language first by watching YouTube videos for the first time. However, despite doing the same, c4477 and c6328 warnings appear, and nothing is executed, so does anyone know why??

c

2022-09-20 10:22

1 Answers

int main_printfscanf(void)

Rename the function above as follows.

int main(void)


2022-09-20 10:22

If you have any answers or tips


© 2022 pinfo. All rights reserved.