Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Hello, and welcome to your first challenge.
This is going to be a rather easy challenge for storage classes.
I provided a quiz.
The storage classes are kind of tough to have programming, exercise in
there that do anything real relevant.
So these are just some easy challenges.
I'm going to provide you with three challenges.
They're really small, but they will help you better
understand storage classes in c.
And as I mentioned, they're quite easy, so they shouldn't take too long.
The first challenge that I want you to write is just a small program that
really just declares some variables.
I want you to declare some variables with specific storage class
specifiers that you need to use.
So for example, you have to clear an invariable block scope in temporary
storage, global double variable that is only accessible inside the file.
Float variable that's global, accessible throughout
the entire program.
A float local variable with permanent storage, a register int variable and
a function that is only accessible within the file that is defined.
So pretty straightforward.
If you understand the storage class specifiers, this is
going to be very easy to do.
Our second challenge is you're going to have to write a c program
that finds the sum of a number.
It's really just going to retain its value for each call.
So you can't pass any variable representing the running
total to the sum function, so it can't take a parameter.
It just takes one parameter for what you want to sum, what you
want to add to the previous total.
So it'll just be a sum function take some number.
You'll find the sum of a number from the previous call.
So you'll see this example in the output.
So for example if I call sum three times passing in 25 15
and 30, the output is actually going to be 25 the first time,
40 the second time and 70 third.
So each time you call it it's summing that number that's
passed in from the previous sum.
So you have to use the storage class specifier to implement this.
The third challenge is you're gonna need to create a c program that
shares a variable amongst two files.
So create a source file named main.c.
The source file should include a globe variable used as a loop counter.
This file includes a main function that uses the global variable to
iterate through a loop five times.
Inside this loop a function should be invoked, something
like a display function that is defined in another file and
you cannot use an include file.
The display function should take two parameters.
And then in the other file display.c, this is where the display function
is defined and this function will display the global variable
from main.c incremented by one.
So since these are pretty easy, I'm not going to actually
have an entire demonstration.
I'm going to provide you with the source files in
this lecture containing the source code for solutions.
If you have any questions, please let me know.
But again, these are rather easy challenges with easy solutions.
So I don't think there's -- it's necessary to provide an
entire demonstration.
Thank you.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.