CSE240 - C LANGUAGE EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS VERIFIED
7 views 0 purchase
Module
CSE240
Institution
CSE240
CSE240 - C LANGUAGE EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS VERIFIED
A data type is...
- a set of possible values
- a set of possible operations on these values
- a representation of these values for a specific machine
four basic types
- char
- int
- float
- double
modifiers
...
- a representation of these values for a specific machine
four basic types
- char
- int
- float
- double
modifiers
used to modify the length or size of data
What are the four derived types in C?
Pointers, arrays, structs, unions
What is the purpose of pointers in C?
To hold the address of entities of some type
Give an example of a pointer declaration in C
char* cptr
(cptr holds the address)
How are structs used in C?
, To group together things of possibly different types
array format
char cArray[n+1]
pointer arithmetic
addresses are integers
i.e. &b + 3
char can range only from
-128 to 127
long can range from
-2,147,483,648 to 2,147,483,647
C does not have a boolean type. How would you define it?
#define BOOL char
#define FALSE 0
#define TRUE 1
int range
-2,147,483,648 to 2,147,483,647
(used for numbers)
most common directive
#include <stdio.h>
int main() { ... }
will return an integer - if our code ran successfully, 0.
- # > 0 means that the program failed
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller NurseAdvocate. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for £8.56. You're not tied to anything after your purchase.