what is the structure of a programm | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is the structure of a programm

how is a working programm build

24th Nov 2017, 10:05 PM
druw davis
druw davis - avatar
1 Answer
+ 4
Did you mean structures ? structured are only in c++ not java . Structures are user defined data types that are used to declare multiple variable that can be accessed by a single parent for example let's consider a structure : struct Profile { char name[50]; int age; short d,y,m; char gen; // You can't declare the value for any member here . It will give an error }; This structure is declare above the main. You can even declare it below the main but then you need to first call it above the main() .Like : struct Profile; This is almost similar to a function . If you want to access any of the data members you can use : it like int main() { Profile p1; // To create an object cin>>p1.age; cout<<p1.age; ... and so on return 0; } For an example program see this : https://code.sololearn.com/cmrgGee0jPrl/?ref=app
25th Nov 2017, 1:05 AM
RZK 022
RZK 022 - avatar