Why this code not working in code blocks( working in VS coe)?

Why this code not working in code blocks( working in VS coe)?

Problem Description:

int qt( int *x);
struct student
    int id;
    char name[10];
    char b_g[10];
    float cgpa;
    char address[20];
int num,i;
int main()
    printf("Input How Many students You Have: ");
int qt(int *x)
    int v,n;
    struct student ar[v];
    printf("Enter Your ID, Name, Blood Group, CGPA, Adress:n");

        scanf("%d %s %s %f %s",&ar[i].id,ar[i].name,ar[i].b_g,&ar[i].cgpa,ar[i].address);
    printf("nEnter Your ID:");
        printf("Student ID:%dnnName: %snBlood Group: %snCGPA: %f nAddress: %sn",n,ar[i].name,ar[i].b_g,ar[i].cgpa,ar[i].address);

it taking many inputs in code blocks that i don’t want to do,,but in same code is working fine in VS code.
I need to run it in code blocks and that should show proper output base on search id.

Solution – 1

Firstly I would say that your qt function should probably actually return an integer at some point, seeing as you’ve declared the return data type without a return statement. Also, as someone mentioned above, it might be helpful going forwards to adopt the widely accepted standard of starting for loops at 0. If adding the return does not fix the issue, could you post the error message you are getting??

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.