Presuming you mean:
"What are structures in C (programming)"
(Data) Structures are a simple way to organize information.
Example:
Suppose you want to make a program that does arithmetic operations on fractions.
Since each fraction can be represented by a nominator and a denominator for each fraction you have you need two integers (or other numeric variable type), the solution with no structs would be to create two arrays , one for the nominators and the other for the denominators:
int nominators[10];
int denominators[10];
The problem with this approach is that it is prone to programmer errors the relation between nominators and denominators is not enforced.
By using structs one could enforce the relation of a nominator with its denominator:
struct Fraction
{
int nominator;
int denominator;
};
This is a struct definition, it defines a new variable type that consists of two int variables
named nominator and denominator. So now you can write this:
struct Fraction fractions[10];
This makes it simpler for the programmer to handle the data.
Structs are declared as any other variable type:
struct Fraction fraction; //The keyword struct is necessary
In order to get a struct's inner variables (members is the usual term) you must use the '.'(full-stop) operator as such:
fraction.nominator = 0; //This will set the nominator member to 0
The initialization of a struct a bit awkward at first:
struct Fraction fraction = {1,2};
This will initialize the nominator member of the variable fraction to 1
and the denominator member to 2.
Hope this solves your query.
'struct tm' (time.h) and 'FILE' (stdio.h)
Yes, in C, you can use the standard programming structures (sequence, selection, repetition).
Because you can use programming structures, namely: sequence, selection (if, switch) and repetition (while, for, do-while)
There is no such thing. Structs and unions have fields, which can be accessed by their names.
structured programming language ex:c,c++
M. Main has written: 'Data structures & other objects using C++' -- subject(s): C++ (Computer program language), Data structures (Computer science), Object-oriented programming (Computer science) 'Data structures and other objects using Java' -- subject(s): Java (Computer program language), Data structures (Computer science) 'Data structures & other objects using C++' -- subject(s): C++ (Computer program language), Data structures (Computer science), Object-oriented programming (Computer science)
With a text editor, and some basic knowledge of the C programming language.
C and C++ are both high-level programming languages.
In Pascal, data structures are implemented with recorddata types. A record is synonymous with the structdata type in C, or the class data type in C++.
create spiral in c programming?
Robert Lafore has written: 'Object-oriented programming in Microsoft C++' -- subject(s): Object-oriented programming (Computer science), C++ (Computer program language), C. 'Microsoft C. Programming for the I.B.M.Personal Computer' 'Object-oriented programming in C++' 'Windows Programming Made Ridiculously Easy Book' 'The Waite Group's C Programming Using Turbo C++ (The Waite Group)' 'Microsoft C programming for the IBM' 'The Waite Group's Microsoft C programming for the PC' -- subject(s): C (Computer program language), IBM microcomputers, Microsoft C (Computer program), Microsoft C., Programming
In C programming, C compiler is user to translate C source into C object module.