Test your knowledge
This is an ungraded check of your knowledge (i.e. I do not look at these results in any way shape or form--nor do they effect your grade).
They are designed so you can have some feedback on the assigned readings/videos/notes to see if you picked up some of the basic knowledge.
In C, do we have to define 'data types' for variables?
Yes, unlike languages like python, when we declare something a 'int' it always holds integer values.
No, C is like python where we do not need to add 'float' 'double' 'char' or any data type.
Does the C language have loops like 'while', 'for'?
Yes, the C language has while and for loops that can be used to iterate.
No, The C language does not.
What is a pointer?
It is regular variable.
It is a regular variable, but it stores an 'address' in memory rather than a value.
If I dereference a pointer, is that always safe? (e.g. *myValue = 5;)
If the pointer does not point to anything (e.g. it is NULL or we did not give it an initial value), then our program will segfault!
Yes, it is alawys safe.
What is a segfault?
A segfault is when you access a piece of memory you do not own. If we think about it, we do not want our programs to be able to access every single piece of memory on our machine (This way if one program crashes, it does not crash the system).
This content is neither created nor endorsed by Google.
Terms of Service