Download presentation
Presentation is loading. Please wait.
Published byKristopher Armstrong Modified over 9 years ago
1
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
2
As we saw General nature of Computer programs. Read or Write to computer memory. Do operations on the data in the computer memory Hand over the data to other parts of the program for more operations. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
3
Variables In C program computer memory is accessed via “variables”. Or variables in C program is a representation of computer memory. Again Variables are nothing but memory so it remember things which we called values in the variable. All variable store binary 1s and 0s as computer cannot remember anything else. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
4
Variable types Based on size and type char, int, float, unsigned int and more ( custom). Based on storage global, static, local or auto and register. One more storage class called thread local storage we wont discussion. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
5
Demo char, int, float, unsigned int. global, static, local or auto and register. scope of variable. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
6
Remember All variables are binary digits at the end of the day. What makes each type different is just the way we interpret it. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
7
Questions Why int is not used for representing English alphabets ? to save memory Why we cannot use float always why we need int? to save CPU time. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
8
Demo Interpreting int as char using %c Looking at memory in visual studio char float and int. Looking at memory to see the actual value stored. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
9
Summary Variables types and classification. All 1s and 0s. All we interpret differently. There is more but this is all we need for now. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
10
Thank you SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.