search

Home  >  Q&A  >  body text

Functions and structures

#include <stdio.h>

struct n

{

int x;

char c;

};

void func(struct n b){

b.x=20,b.c='y';

}

void main(){

struct n a={10,'x'};

func(a);

printf("%d,%c",a.x,a.c);

}

Why is the final result 10, x please answer it

仰望星空仰望星空1567 days ago1164

reply all(0)I'll reply

No reply
  • Cancelreply