plc.myforum.ro Forum Index plc.myforum.ro
PLCs users www.plc.myforum.ro!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

calling a structure within a structure in mistubishi

 
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> Other PLCs
View previous topic :: View next topic  
Author Message
rahul7012
Junior
Junior


Joined: 14 Aug 2019
Posts: 1
Location: Delhi

PostPosted: 14/08/2019 10:36    Post subject: calling a structure within a structure in mistubishi Reply with quote

i am trying to convert one of my programs made in studio 5000 (allen bradley) into mistubishi using cxworks2 i am not able to create nested structure any help would be useful
_________________
Rahul
Back to top
View user's profile Send private message
ubegrof
Junior
Junior


Joined: 29 May 2019
Posts: 5

PostPosted: 14/08/2019 17:15    Post subject: Reply with quote

in C
Code:
#include <stdio>
#include <string>
 
struct student_college_detail
{
    int college_id;
    char college_name[50];
};
 
struct student_detail
{
    int id;
    char name[20];
    float percentage;
    // structure within structure
    struct student_college_detail clg_data;
}stu_data;
 
int main()
{
    struct student_detail stu_data = {1, "Raju", 90.5, 71145,
                                       "Anna University"};
    printf(" Id is: %d \n", stu_data.id);
    printf(" Name is: %s \n", stu_data.name);
    printf(" Percentage is: %f \n\n", stu_data.percentage);
 
    printf(" College Id is: %d \n",
                    stu_data.clg_data.college_id);
    printf(" College Name is: %s \n",
                    stu_data.clg_data.college_name);
    return 0;
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    plc.myforum.ro Forum Index -> Other PLCs All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro