Transcripts
1. C Programming Course Introduction: Come, everyone to the complete C programming language course. This course consists
of different classes. We are going to discuss
about the concepts like how to run the C program
in visual studio code. And also, we are
going to discuss about variables, data ts, RA, structure, ese
conditional statement, loops, in C
programming language. This course is very, very useful for the beginners who are trying to learn C programming language
for the first time. So let's get started.
2. C Class 1 : Introduction To C: Welcome, everyone
to the first class. In today's class, we're
going to discuss about introduction to C
programming language. So C programming language is a structured programming
language developed in the year 1972 by Dennis Richie. You need to know that C
programming was introduced in the year 1972
by Dennis Richie. Also, you need to know that C programming language
is a low level language. You can use that to interact directly with the computer
hardware and memory. Also, C programming
is considered as an base for other
programming language. That is why it is known as mother of all
programming languages. At last, you can see that C programming language is
a compiler based language. That's the introduction
to C programming. After that, we're
going to discuss about advantages of C. The first
one is the performance. C code can be directly compiled
into missing language. That makes the C code
very faster in execution. That's the performance, and then second one is nothing
but flexibility. C programming consists
of memory management. If you want to
manage your memory, you can use C
programming language. And then third one
is the portability. C programming can be run in all OS like Windows,
LNAx, and Mac. And then you can see
the fourth advantage that is widely used. C is a mother of other
programming language. For that, you can use C programming language for
creating the applications. Also, you can use C programming for creating the
operating system. After that, we are
going to discuss about the drawbacks of C
programming language. So the first tone is the error. So C programming
language is very less secure than other
programming languages. So I can lead to memory
leak sun buffer overflow. That's the first disadvantage. After that, you can see
the second disadvantage, that is complex syntax. C syntax is very complex than other programming
language syntax. So if you compare the C
syntax with Python syntax, it is very difficult for
beginners to understand. And then third disadvantage is nothing but limited abstraction. If you use C
programming language, you have to manually manage
the memory and resources. So that's the disadvantage
of C programming language. So after that we are going
to discuss about what are all the applications that can be created using C
programming language. So the first one is
the operating system. For example, using the
C programming language, the Linux unix
windows are created. And then database. Using the C
programming language, you can create a databases
like M SQL and Pc SQL. These are all the examples
that can be created using C. Other third one is nothing
but embedded system. Using the C
programming language, we can use that for
microcontrollers and robotics. And then you can see the
graphic applications that can be created using C, for example, adop
Photos and blender. These are created using the
C programming language. If you learn C
programming language, you can achieve the jobs like
operating system developer, embedded system developer,
system programmer that is nothing but software developer
and scientific computing. So these are all the
jobs that can be achieved when you learn
C programming language. That's it, guys,
in today's class, we are discussed about
the introduction to C programming language.
3. C Class 2 : Running C in VS Code: Come, everyone.
In today's class, we're going to discuss
about how to run C program in Whistles
Studio Code. So there are other IDE for
running the C program. You can see the ID
like code blocks, turbo C code D C plus plus. But in today's class, we're going to
discuss about how to run the C program in
Viscle Studio Code. For that D need to
create a new folder, and then you have to open
that folder with VS code. After opening the VS code, you need to install
some of the ten sN for running the C program
in is Studio Code. For that, you need
to open the Google, and then you have to type Ming, so you have to type
Ming 64 download. Minimal list. You have to
type minimalist, download. You have to open
the first website. That's the Ming 64 minimalist. You have to open the
Source Forge website. And then you have
to download that. After that, you need
to install that. You have to select the
options like continue, so you have to select
the continue option. And then you have to select
the options like Ming, C plus plus, and
C, GCC, and base. You have to select that,
and then you have to select installation
in the package. After that, you have
to open the window C, in that you have to
search for Ming. So you have to open that folder. You need to copy the Bing path, and then you have
to paste that path in the environment variables. After that, only you can run the C program in
Visual Studio code. In that folder, you can see the options like
GCC, C plus plus. After that, you need to open
the visual studio code, and then you have to
install other extension. For that, you need to open
the extension in VS code, and then you have to
type C plus plus. In that, you can
see the extensions. So you have to install the
verified extension only. We need to install some
of the extensions. Whatever you want,
you can install. But you have to
install only verified. After installing the extension, you need to create new
file for the C program. We need to type C. We are successfully installed
C in Visual Studio code. You need to type the name of
the file and save the file. I'm going to type Hol world dot C. Dot C is the
extension for C program. So you have to save the file. So now we are going to
discuss about how to run our first program
in Visual Studio Code. For that, we are going to
see the syntax C program. First, you need to include
all the header files. So whatever header files you need for your program,
you have to include. So for basic, you need
to include standard IO, that is input and
output header file. And then you need to
create the main function. So you need to type int main. There are two types of main
functions, wide and int. You can select any one of them. And then inside
the curly bracket, we are going to
print the output. For that, you need to print
tu for printing the output. So inside the bracket, you need to type the string. I'm going to type color world. At last you have to type semicolon for ending
the statement. If you don't type semicolon, it will generate error. So if you want to
return any value, you can type written zero. You have to take 100. After that, you need
to run the code, you can see the
output Holor World is successfully generated
in the VIS Studio Code. This is how you can run C
program in IS Studio Code. You need to download the
M for a GCC compiler.
4. C Class 3 : Variables: Welcome, everyone.
In today's class, we're going to discuss
about how to create variables in C
programming language. So variables are nothing, but it is a container
which is those the value. So that's the simple
definition for variables. Before that, you need
to type the syntax for header files
and main function. So first, you need
to type the include. You need to include
the header files. For that INA to type has
include STD IO dot t, and then you need to
type the main function in main of Inside
the curly brackets, we are going to
create the variables. For creating the
variables, first, you need to type the data type, whether it can be in
float character double. You need to type
the data type and then you have to type
the variable name. Variable name cannot
be start with digit. You need to know about the rules for creating the variables. You have to type
the variable name, that is a Then to type equal, and then you have
to type the value. This is the declaration and
initialization of variable. After that, if you want to
print the variable value, you have to type
print of command. Inside the print of command, you need to type the specifier. For integer, you
need to type percent d. And then you have to type
the value of the variable. We have to type A. This is how you can print the variables in C programming language. We need to type the specifier. If you don't type the specifier, it will generate ten error. After that, I'm going
to run the code, you to select run code in that, you can see the output ten. That's our integer variable.
That's it, everyone. In today's class, we are
discussed about how to create variables in C
programming language. You need to know about the
concept of type specifier.
5. C Class 4 : Datatype: Welcome, everyone.
In today's class, we're going to discuss
about data types in C programming language. So the first data type is integer and character
float double. In C programming language, there is no data
type for string. So String will be
considered as array of characters in C
programming language. So we are going to discuss an example for the
data type one by one. First, you need to
include the header files. So we need to include
STD, that is standard, and then IO IO is nothing, but Input and output, dot H is nothing but header, and then you need to
type the main function, inside the main function, we're going to create
the data type. We're going to create integer
data type t equal to ten. To type C Ar, that's
the character. And then you need to type the variable B equal to ed
to type single quotation. Inside that, you can
type the character. A two set, you can
type any one of them. If you want to create float, you have to type float, and then you have to type the
variable equal to. You need to type 10.5. After that, we are
going to create the fourth data type
that is double. You have to type dou
D equal to 20.66. Float is for the
smaller point values and double is for
larger point values. After that, if you want to print the variables, you
need to type print. Also, you need to
type the specifier. Percentage D for the and then to type the
variable that is A, and then we are going to
print the second data type, that is C, that is character. We need to type percentage C, and then B, B is
nothing but character. And then print F
of percentage F, common C. That's the float and then double for that
you need to type print F. Inside that, you need to type percentage, F. Then you need to type D. It will print
all the variables, invariable and
character variable float variable and double. Also, if you want to print the output in new
line auto types, ssn, If you don't type slash n, it will print in the same line. You need to run the code and
you can see the output ten, that's the in, and A,
that's the character. That's it, guys,
in today's class, we are discussing
about data types in C programming language.
6. C Class 5 : String: Welcome, everyone.
In today's class, we're going to
discuss about how to create string using
character array. For that, we are going to see an example before
that you need to type the ter pi and then you need to type
the main function, you have to type in main off. And then you have to
type curly brackets. Inside that we're going
to discuss how to create string using
character array. For that you need to type
character of equal a, you need to type
double quotation. If you want to create string
using the character array, you have to type
double quotation. Inside that you can
type your own string. That is color world. I'm going to type Hlor world. This is how you can create string using the
character array. Also, you need to know about
the index concept in array. H is the starting index, that is the zero index. E is the first index, N is the second up to D. Space is also
considered a N index. Halo space world,
space is also n index. You can see the total count 12. After that, we are going to
print the RA using the print F. You have to type print
to type percentage, yes. Inside the quotation, you
have to type percentage, yes, and then you have
to type the array. A. If you run the core, you can see the
output holor world. That's it, guys.
In today's class, we are discussed about how to create string using
character RA.
7. C Class 6 : User input: Welcome everyone.
In today's class, we're going to discuss
about how to get user input in C
programming language. You need to type the Hope
first for that to type, include and then STD, o dot t, and then main
function in main. Inside the main function, you have to type
the print to type print F, type N, integer. We are going to ask
integer from the user. And then you have to type scanf. It will read the input. You have to type scanf. Inside the quotation, you
need to type the specifier. For integer, you need
to type percentage D. And then you need to type
the symbol am present. It will get the input and store the input in
the A variable. And then we are going
to print the A value. Using the print, you have
to type percentage d, and then you have to
type the value A. That's the variable.
Before that, you need to initize
the variable. I need to type A. So just declare the variable. This is the example for getting the user input in C
programming language. For that, you need
to use the scan. It will read the input and store the input
in the variable, and then e how to
print the variable. You can see the
output, type in tag. Sang to type 100. You can see the output 100
is successfully printed. That's it guys in today's class, we are discussed
about how to get user input in C
programming language.
8. C Class 7 : Logical Operator: Welcome, everyone.
In today's class, we're going to discuss
about logical operator in C programming language. There are three logical
operators and not. We are going to discuss
that one by one. Before that, you need to type the standard header
files and main function. We need to type SDO
dot t. Then you need to type the main function
in main of curly brackets, inside the curly brackets, we're going to discuss
our logical operators. Before that, you need
to type the variables. I'm going to type
int A equal te. Ten and b equal to five. These two variables are useful
for our logical operators. First, we're going to discuss
about ogical operator. For that, we are going to
use the printer function. Inside the quotation, you
need to type the specifier. That is percentage D for
the integer data type, and then you need to type the condition for
ological operator. Minimum two conditions be
in the logical operator of A greater than B
and A less than B. So In ontological operator, both the condition must be true. Then only the output
will serve true. If any one of them is false, the output will serve false. So that's the concept of
ontological operator. For false, it will serve
the boolean value zero. For true, it will serve
the Boolean value one. So you need to run the code. So you can see the output zero. That is nothing but false because one condition
is not satisfied. So first condition is satisfied, but second condition
is not satisfied. So that's why the output
serves zero. That is false. So after that, we are going to discuss about our
logical operator. For that you need
to type print F inside the quotation in
order to type the specifier, and then you need to
type the condition. A greater than B, and then you
need to type the operator, and then A less than B. In our logical operator, any one must be true. Then the output will serve one. If both conditions are false, then the output solves zero. After that, you need
to run the code, you can see the output one. One condition is satisfied. That's why the
output source one. A greater than B, A
is greater than B, then the condition is true, the output source one. Then we are going to discuss
about not logical operator. For that, you need
to type print F, inside the quotation,
you need to type the specifier, and
then you have to type. You have to type the condition. I'm going to use the
unilogical operator. We know that this
output will so false, but not will reverse the output. So true becomes false,
false, becomes true. That's the concept of Not
will reverse the output. Zero becomes one,
one becomes zero. You need to run the core. So we can see the
output zero, one, one. First, ological operator,
the output source zero, but in naught, the
output source one. That's the concept of naught. It will reverse the output.
9. C Class 8 : If Else: However, in today's class, we're going to discuss about
false conditional statement in C programming language. We are going to discuss
an example for that. Before that, you need to type
the standard Eder files, and then you need to type
the main function that is int main inside the
curly brackets, we are going to discuss our
false conditional statement. For that, we are going
to create two variables. We need to type
the data type and then variable name
equal to value. So n d equal to ten
and n b equal to 20. So we just created
two variables. After that, you need to
type the keyword, that is, if in that, you have
to type the condition. So condition can be your own
choice. A greater than B. Then curly brackets,
inside that, we are going to print
the value print bracket. A is greater than B. If the value of A
is greater than B, then the if condition
will be executed. If the I condition
is not satisfied, then the els will be executed. Inside the els, we can
print our default value. So after that, you
need to run the code, you can see the output. B is greater than A, B A value is ten, but B value is 20. B is greater than A. That's why the output
el is satisfied, then the output source, B is greater than A. After that, if you
want to create more condition in C
programming language, you have to use LF. We have to type LF,
that's the keyword. Inside that to type
the condition, A equal to equal to b. Inside the curly brackets, you have to type the print f. And then we are going
to print the value. A is equal to b. Have to type the semicolon
to n the statement. If we don't type the semicolon, it will generate syntax error. We know that condition will sow the output because that
condition is satisfied. If I change the value to a equal to ten and
b equal to ten, then we know that F will be
generated in the output. We need to run the code. You can see the output,
A is equal to b. That's it guys in today's class, we are discussed about a
first conditional statement in C programming language.
10. C Class 9 : Switch: Welcome, everyone.
In today's class, we're going to discuss about
switch conditional statement in C programming language. So it is an alternative to e
false conditional statement. So far that we are going
to see an example how to create switch in C
programming language. So before that, you need
to type the basic syntax. So that's the header
files S SDO dot, and then you need to
type the main function. Inside the curly brackets, we are going to
discuss our switch we are going to
create the variable that is d equal to four. You need to type the keyword, that is the switch, and then you have to type the variable
inside the bracket. We have to type D and then you have to
type curly brackets. This is the syntax four creating the switch
in C programming. After that, we are
going to create conditional statement
that is case. If the case one is satisfied, then the code block will
be executed in the output. The block will be print F.
I'm going to print F Monday. If the day value satisfied
with the case one, it will print Monday. Also, you have to type break. If you don't type break, other case will be
executed in the output. After that, we're going
to create case two, and then I'm going
to print Tuesday. If the day value satisfied
with the case two, then print will
generate Tuesday. After that, I'm going
to create case four, so you can type your own case based on your own programming. I'm going to print Thursday. And then you need to type
semicolon to end the statement. Also, you need to
type break keyword. If you don't type break, other case will be
generated in the output. If the condition is satisfied, it will exceed the switch. That's the use of break. This is how you can create switch in C
programming language. First, we are
created the variable that is d equal to four. So if the value of d equal to four satisfied with any
one of the cases value, then the code block will
be executed in the output. We know that case four
will be executed in the output because the value
is satisfied with the case. It will print the
output Thursday. We have to run the code. You
can see the output Thursday. If I change to other
value that is two or one, and then run the code, we know that Monday will
be printed in the output. And then I'm going
to change two, two, and then run the code. We know that case two
will be executed. You can see the
output, two state. Also, you can create
default case in switch. If all the cases are not
satisfied are any invalid input, you can create default case. It will print the
default output. That's it, guys,
in today's class, we are discussed about switch
in C programming language.
11. C Class 10 : For Loop: Come, everyone.
In today's class, we're going to see an
example far far loop. For example, I'm going
to print the same A or hollow world for ten
times using the far loop. Before that, you need
to t the main function. Inside the main function, we are going to see an
example for far loop. So you have to tie
the character. I'm going to print
A far ten times. Using the far loop. After that,
you need to type the far. Inside the open bracket, you need to type the
syntax far far loop. First, you need to type
the starting value. That is t equal to zero. R one, you can type your
own starting value, and then you have to type the
condition i less than ten. And then plus plus. You need to increment
the value one by one. First, you have to type
the starting value, and then you need to
type the condition. The condition is
zero less than ten. As the condition is satisfied, then the value of will be
incremented one by one. That's the i plus plus. Inside the far loop,
we are going to print the value of A ten times
using the print f. You need to type
percentage C, N, C. Will print the
value of A ten times. After that, you need
to run the code, you can see the output. A will be printed ten
times using the far loop. This is how you can use far
C programming language.
12. C Class 11 : While Loop: Welcome, everyone.
In today's class, we're going to
discuss about loops in C programming language. First, we are going to
discuss about wild loop. Loops are very, very important
in programming language. For example, if I want to
print Hol world for ten times, for default, I'm going
to type print F H world, Hol World Hol World
for ten times. For this problem, the loops are introduced in
programming language. So loops are based
on some condition. If the condition is satisfied, then we can print the output. So F that we are going to see an example before that we
need to type the header file. After that, you need to
type the main function. You need to type
the open bracket. If you don't type the open
bracket and closed bracket, it will generate an error. Inside that, I'm going to create character in C
programming language, there is no string, so that's why you need
to type character. If I want to print A for
more than ten times, I'm going to use loop,
that is wil loop. After that, you need to type the starting value for the loop. For that, you need to
type int i equal to. Zero r one. It is
your own choice. After that, you need to type il. That's the keyword, and then you have to
type open bracket. Inside that, you need
to type the condition. Condition is very, very
important in loop. The condition is less than ten. It will print the
loop for ten times. After that, you need to
type the curly brackets. Inside the curly brackets, we are going to print
the A for ten times. F that you need to type print f, and then you need
to type percentage C. That's the specifier and then slash n for new line and then
you need to type the value. That is C. And then you need to increment the
value one by one for that to type i plus plus. It will print the
output one by one. First, you need to
type the value. That's the variable A. I'm going to print
A for ten times. And then you need to type the
starting value zero or one. And then you need
to type the oil. Inside the oil, you need
to type the condition. The condition is less than ten. That is zero less than ten. As the condition is satisfied, then the loop will be executed. First, it will print
the output one time, then i plus plus will increment
the value one by one. So I becomes zero, one, two, three, four. So up to nine, the condition is satisfied. When the value of i becomes ten, the condition is not satisfied because ten is not
less than ten, ten is equal to ten, then the loop will be it. So that's the concept of loops
in C programming language. So after that, you need to run the code, you can
see the output. A will be printed ten times. So this is how you can use Y loop in C
programming language, also other programming
languages.
13. C Class 12 : Break & Continue: Welcome, everyone.
In today's class, we're going to discuss
about break and continue in C
programming language. Break is nothing but it will exceed the loop when the
condition is satisfied. And continue is nothing
but it will skip the particular value in the loop when the
condition is satisfied. For break can continue, we are going to see an
example using the far loop. Before that you need to
type the header fel, that is nothing but standard
input output dot t, and then you need to type the
main function int main of. Inside the main function, we are going to create
the starting value. That is int i equal to zero, or int, we are just
declaring the value. After that, we are
going to use the, to type f, and then to
type the starting value, I equal to zero, and then to type the condition, less than ten, and then you need to type the increment
value plus plus. This is the syntax for far loop. After that, we are going
to type the if condition. If the value of I becomes five, then we will except the
loop using the break. That's the use of break. If the value of I becomes
f during the increment, then we will break the loop. And then you have to
print the value using the type specifier have
to type, percentage D, and then slan for the new
line and then to type, I is nothing but the
value of zero to ten. It will print the value 0-10. But if the value
of I becomes five, it will exit the loop. You need to run the
code, you can see the output zero to four, and then you can see
the loop is exit. Because the I value
becomes five, then we will break the loop. You can see the
output zero to four. When the value of
I becomes five, the loop is exit. That's the use of break. After that, we are going
to discuss about continue. Continue is nothing, but it will skip the particular
value in the loop. You can see the
output zero to nine, but we cannot see the value six because it will
skip the value. You can see zero, one, two, three, four, five,
seven, eight, nine. When the value of i becomes six, it will skip the value
using the continue. That's it guys in today's class, we are discussed about
continue and break in f.
14. C Class 13 : Array: Welcome, everyone.
In today's last, we're going to discuss about RA in C programming language. RA is one of the derived
data type in C programming. RA is useful for
storing the elements. Far that we are going
to see an example how to create RA
in C programming. Before that, you need to
include the ter files, and then you have to
type the main function. Inside the main function, we are going to
create RA for that, you need to type int. First, we are going to
create integer data type A. It A, and then you have to type the
square bracket equal to. You need to type
the curly brackets inside that have
to type the value. That is the integer
value, 102040. After that, we are going
to create A character. You can type single quotation, A, I'm going to type
uppercase and lowercase. This is considered as
character data type array. First one is the integer array, second lone is the
character array. After that, you need to know
about the concept of index. RA is based on the
index concept. RA index starts from zero, and then one and then two, and then three based on
the element in the array. So ten is nothing
but 024-134-2443. So the starting value
is zero, the index. First, we are going to print the elements using
the index position. So we need to type percentage D, and then you have to type
the variable array of zero, zero is nothing but zero index. So we are going to
print the value ten using the zero index. So you have to run the code, you can see the output ten. If I want to print 40, you to change the
index position 23. It will print the output. You can see the output, 40. This is how you can print the single element in the array. If you want to print all
the elements in the array, you have to use f. For that, you need to type
the four syntax. First, you need to type
the starting value, that is t equaled zero. That's the starting index, and then less than,
that is the condition, and then you have to type
the value of the condition, less than four,
and then plus les. Inside the R loop, I'm going to print all
the elements using print f. You have to
type percentage D, to type array name that is a of. I is nothing but
the rating value. It will print all the
elements in the array. You can see 10203040. These are all the elements
present in the array.
15. C Class 14 : File : Welcome, everyone.
In today's class, we're going to discuss
about how to create read write file in C
programming language. Far that we are going
to see an example. Before that, you need to
type the basic syntax, that's the heather file
and main function, and then we need
to type the file. That's the key word
for creating the file, and then we are going
to create pointer. Star A is nothing but pointer. After that, you need to type the pointer that is
A equal to F opened. If you want to open any file, you have to type F opened,
inside the bracket, you have to type the file
N. I'm going to type. Sample dot txt. I write mode. There
are three mode, write mode, read
mode upend mode. First, we are going to
use the write mode. I'm going to write some text
in the sample dot txt file. After that, you need
to close the file using the F close function. It will close the file. You need to run the code. After that, you're
to open your folder, sample dot txt file is successfully created
using our C program. There is no text in
our sample d txt file. We're just creating the file. After that, we're going to write the text inside
the sample d txt. For that, we're going
to say an example, to type F print
f. That's the pi, and then you have to type
the string. Her world. It will print the
output inside the file. You have to run the code again. You have to open
the txt file again, so you can see the
output, Hl world.
16. C Class 15 : Pointers: Welcome, everyone.
In today's class, we're going to discuss
about pointers in C programming language. So Pointer is a variable, which is another
variable address. So that's the
concept of pointers. It is a variable, which is
another variable address. So we're going to
see an example for creating the pointers in
C programming language. Before that, you need to include the header file that
you have to type, include STD, io dot. It will include the header file. And then we need to
type the main function. Co type int main
of curly brackets. Before that, we need
to create a variable, and then we are going
to create pointer. Co type int A equal to ten. After that, we are going
to create pointer to type in star B equal to. If we want to store the
address of another variable, to type Ambrasent symbol, Ambrasent, and then
another variable name. That is A. This is how you can create pointer in C
programming language. Star B is a pointer variable, which stores the
address of A variable. After that, we are going to
print the values one by one. So you need to tie
print of percentage D, and then we are going
to print A value. It will print the value of ten. And then we are going to
print the value of pointer. We need to type percents P. P is nothing but
pointer type specifier. B is nothing but a pointer. For that, you need to
type the specifier, and then you need to
type the Ambrason A. Ambrason A is nothing but
address of the A variable. I have to run the code, so you can see the output
ten is nothing but a value. And then second on is nothing
but address of the A value. Ambrasan, will
store the address. If we want to print the
address, to type Ambrasan. After that, we are going
to print the pointer, you need to change the
code percentage B, you need to run the code. You can see the output. Before that, you
need to type ssn, You have to change the code for printing the output
in the new line, to type lasan then run the code. You can see the output, ten
is nothing but a value, and second is
nothing but Ambres, and A is nothing but it will
print the address and B also print the
address because it sts the address of
another variable. B is also printing the same
address of A variable. So pointer is nothing
but it is a variable, which is stores another
variable address. For storing the address, you need to type ambersent. After that, after
that we're going to discuss about the
concept of D reference. D reference is nothing but we're going to
print the value. So after that we're
going to discuss about the concept
of D reference. So D reference is nothing
but it will print the original value
from the pointer. So that's the D reference. F D reference, you need
to type the symbol star. So F that we're going
to see an example. So we're going to print star, star B is nothing but it will
print the original value. You have to run the code,
so you can see the output. So ten is nothing
but A variable. That's the first output. Ambers en is nothing but
it will print the address, and then second, that is
B will store the address. That's why it sows the output. B is a pointer, which is so the address of
the A variable. That's the output is same, and then star B, star B
is it will the reference. Atres becomes the
original value. D reference is nothing, but it will print the original value. If you type star, B, it will print the original
value. That is ten. That's it, guys,
in today's class, we are discussed about pointers in C programming language. There are two concepts
you need to understand. If you want to
print the address, you have to use Amberson symbol. If you want to print
the original value, you have to use star.
17. C Class 16 : Structure: Welcome, everyone.
In today's class, we're going to discuss
about structure in C programming language. So structure is one of the user defined data type in C
programming language. So if you want to store different data
types in one place, you have to use structure. So in array, you cannot
use different data types. You can create only for
similar data types. But in structure, you can store different data
types in one place. For that, we are going
to see an example. So before that, you need
to type the header files. After that we're going
to create structure, you have to type
the keyword struct and then you to type the
name of the structure. And then he to type
curly brackets. And then here to type
semicolon to n the statement. If you don't type the semicolon, it will generate error. So Inside the structure, we are going to declare
our data types. So to type the data
types one by one. I'm going to type t x. And then float y, and then character C.
Inside the structure, you cannot insize the value. You can only declare
the variables. If you try to inize the value, it will sew one error. So you can only
declare the values. After that, we are going to
create the main function, inside the main function, we can inize the value for
the structure data type. For that, you need
to create strut, and then you have to type
the name of the structure. After that you have
to type the object. Using that, we can
initize the value. You have to type B
x, equal to ten. After that, you need to
type B dot equal to 10.44. That's the float, and then OB dot c equal to
single quotation A. This is how you can initize the value for the
structure elements. After that, if you want
to print the elements, you have to type, print. Inside that you have to type
the specifier percent D, and then you have to type OB dot s. Then you can
print the output. If you type X, it
will sew on error. You have to type O B dot. D operator is for
accessing the values. After that, you need
to run the code. Can see the output ten. That's the integer
type in the structure. That's it, guys
in today's class, we have discussed
about how to create structure in C
programming language.