The document discusses structures in C programming. Some key points:
- A structure defines a new data type that groups together different data types under a single name.
- Structures allow programmers to organize related data items into records or objects.
- Structure members are accessed using the dot operator (.).
- Arrays of structures can be defined to store multiple records of the same kind.
- Structures can be nested by defining a structure as a member of another structure. This allows grouping related structures.
C Programming/Strings. A string in C is merely an array of characters. The length of a string is determined by a terminating null character: '-' . So, a string with the contents, say, "abc" has four characters: 'a' , 'b' , 'c' , and the terminating null character.
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
C Programming/Strings. A string in C is merely an array of characters. The length of a string is determined by a terminating null character: '-' . So, a string with the contents, say, "abc" has four characters: 'a' , 'b' , 'c' , and the terminating null character.
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
A structure is a collection of variables referenced under one name providing a convenient means of keeping related information together. The structure definition creates a format that may be used to declare structure variables in a program later. data structure in c questions and answer
● Concept of Structure and Union
● Declaration and Initialization of structure and union
● Nested structures
● Array of Structures
● Passing structure to functions
In this slide given description about different Type of Single phase induction Motor.
i.e.Capacitor start motor
Permanent capacitor motor
Capacitor start capacitor run motor
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Basic of Structure,Structure members,Accessing Structure member,Nested Structure….
1.
2.
3. Structure is a group of variables
of different types known by a
single name
4. Syntax for defining the structure
struct struct_name
{
data type var1;
data type var2;
.
.
};
5. Struct_name provides a name of
structure.
It is a user defined name.
Members of structure are written in
curly {} braces.
The structure definition is terminated
by semicolon (;) symbol.
6. Above definition declares a
structure named as student, having
6 member variables.
Rollno and Age are integers,
while name, city, address and sex
is a character type variable.
7. EXAMPLE : For the student, we can
write the structure as shown below
struct student
{
int rollno;
char name[25];
char address[30];
char city[15];
char sex;
int age;
};
8. ACCESSING STRUCTURE MEMBERS
We can access the individual members of a
structure using the dot(.) operator.The dot(.)
operator is called as structure member operator
because it connects the structure variable and its
member variable.
The syntax is:
struct_var.struct_member;
Where,struct_var is a variable of structure
type,while struct_member is a name of a
member variable of structure……
9. For example,for the struct student with s1 and s2 as
variables,
S1.rollno=5;
S1.age=20;
S2.rollno=7;
S2.age=21;
S1.sex=‘m’;
S2.sex=‘f’;
Above code assigns student s1 rollno=5,age=20 and
sex=‘m’ while for student s2 rollno=7,age=21 and
sex=‘f’.
10. >> Write a program to input and print following
details of student using structure-roll
number,name,address,city,sex and age……
#include<stdio.h>
#include<conio.h>
Void main()
{
struct student
{
Int rollno;
Char name[20];
Char address[30];
Char city[20];
Char sex;
Int age;
};
13. ARRAY OF STRUCTURES
suppose we want to store details of 10 students do instead if
declaring 50 new variables to store details of 10 students we
can declare an array of size 10 to store the details.
For example,
Struct student
{
int rollno;
char name[25];
char adress[30];
char city[15];
}
Struct students s[10];
14. A program to calculate average marks of N for
three different subjects
#include<stdio.h>
#include<conio.h>
struct stud_exam
{
char name[20];
int m1;
int m2;
15. int m3;
float avg;
}
Void main( )
{
struct stud_exam st[10];
int I,n;
clrscr();
printf(“hoe many students?n’);
Scanf(“%d”,&n”);
for (i=0;i<n;i++)
printf(“give name :”);
scanf(“%s”,st[i],name);
printf(“n give marks of sub 1,2 and 3 ;”0;
scanf(“%d%d%d”,&st[i].m1,&st[i].m2,&st[i].m3);
st[i].avg={st[i].m1+st[i].m2+st[i].m3}/3;
17. STRUCTURE INTTIALIZATION
As applicabale to basic data types, we can
also initialize the structure variable at the
time of creation of variables.for our student
structure example,it can written as:
Struct student:
{
Int rollno;
Char name[25];
Char address[30];
Char city[15];
Char sex;
Int age;
18. char age;
);
.
.
Struct student s1 = { 1, “vansh”
“universityroad” , “patan”, “m”, 3};
Struct student s2 = { 2, “saniya”, “krishna nagar”,
“ahemdabad”, 4);
In above codes, the two lines
Struct student s1 = { 1, “vansh”, “universityroad”,
“patan”, ‘m’,3};
Struct student s2 = { 2, “saniya”, “krishna nagar”,
“ahemdabad”,4);
Initializes the structure variables s1 and s2 with the
values written in
{} brackets
19. • If all the values in initialization are not
supplied,then rest of the member variables
will be initialized to zero fornumbers and null
to strings.
for examole,
Student s1 = { 1, “vansh”};
Will initialize only the rollno and name,while
other variables are initialized to zero or null
whichever is applicable.
20. Program about domanstarte initialization of
structure members…..
# include <stdio.h>
# include <conio.h>
Struct book
{
Char title[25];
Char author[20];
Char publisher[20];
Int page;
Float price;
};
Void main()
{
Struct book bk = { “c pograming”,
“xyz”, “abc”,441,275};
Clrscr ();
Getch();
}
21. • Output
title = c pograming, author name =xyz
Publisher = abc ltd
Pages =441, price = 275.0
22. Nestead structures:
When the member variable of a
structure itself is a structure, it is
called as nesting of structure. The
structure which is nested inside
other structure must be declared as
a structure before the structure in
which it is nested.
23. Suppose we want to include the birth date in stead of
age in student structure, we can first define a
structure for date as shown.
struct date
{
int day;
int month;
int year;
};
struct student
{
int rollno;
char name[25];
char address[30];
char city[15];
char sex;
struct date bdate;
} ;
24. here, in the definition of student structure, last
member bdate itself is a structure of type data. The
data structure is declared as having three parts namely:
day, month and year.
struct student s1;
s1.bdate.year = 1995;
s1.bdate.month=1;
s1.bdate.day =1;
In above declaration of date and student, we
can declare variables of date as well as
student type.
25. But if the above definition is written as:
stuct student
{
int rollno;
char name[25];
char address[30];
char city[15];
char sex;
struct date
{
int day;
int month;
int year;
} bdate;
} ;
26. continued….
Then we can create variables of student type
only. We can not create variables of data type.
so, effectively date structure is not global data
type, but it becomes local to student data
type.
if we have declared the variable s1 as
Struct student s1;
Then we can access day by statement:
s1.bdate.day;