Jump to content

Struct Table in C


MELDAW

Recommended Posts

Hello,

The syntax is not correct.

If you want to use the Var_Struct_Student variable, don't specify again the type.

The compiler understands that you want to redefine the type Student.

I don't know what you intend to do with the variable Var_Struct_Student, but this is an exampple of a correct way to use it:

 

int i = 0;

Var_Struct_Student[i].rollNumber = 5;

 

(note: there is another issue here, that you use i before you assign a value to it.)

I would suggest you to get a more solid C background, before using C functions, as debugging them could be more painful than ladder.

C functions are of the type "you know what you are doing? So go for it!"

Hope that helped

Rivka

  • Like 1
Link to comment
Share on other sites

Yes thank you for reply, it helped.
And yes i know that was i didn't assign a value for i, since in memory they can give an random number for i so i need to asign it, but it was only rapid thing to show you my problem in struct.
Thank you for your help. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.