MELDAW Posted January 2 Report Share Posted January 2 Hello, I was trying to create a struct table in C, i tried in my C complier and it worked, but when i complie in unilogic i get errors, is there a syntaxe i should use in unilogic? Quote Link to comment Share on other sites More sharing options...
Rivka Posted January 2 Report Share Posted January 2 Hello, Do you mean an array of structs? Can you post the exact syntax you are using and the error given by UniLogic compiler? Thanks Quote Link to comment Share on other sites More sharing options...
MELDAW Posted January 2 Author Report Share Posted January 2 Yes, I will send you screen captures Quote Link to comment Share on other sites More sharing options...
Rivka Posted January 3 Report Share Posted January 3 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 1 Quote Link to comment Share on other sites More sharing options...
MELDAW Posted January 3 Author Report Share Posted January 3 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. Quote Link to comment Share on other sites More sharing options...
Rivka Posted January 3 Report Share Posted January 3 Happy to hear it was helpful! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.