Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CPSC 1020 Final Exam 2023 with correct answers

Rating
-
Sold
-
Pages
4
Grade
A+
Uploaded on
19-06-2023
Written in
2022/2023

typedef struct Car car_t; struct car_t { char make[20]; int year; char model[20]; }; creating a c style struct car_t * carPtrs[10]; int i; for(i = 0; i 10; i++) { carPtrs[i] = (car_t*) malloc(sizeof(car_t));; } creating an array of car_t pointers and dynamically allocating memory for them void type of pointer returned by malloc . operator used to access members of a struct - operator used to access member of a struct pointer runtime the point at which we know how much space to use for a variable stdlib header file that must be included to use malloc free() function to call on a malloced pointer void(*numPtr)(int); function pointer to the function printNum(int); numPtr = &printNum; initializing the function pointer to point to the function printNum numPtr(54); using the function pointer to pass the value of 54 to the function int arr = (int)malloc(rowcolsizeof(int)); example of mallocing for a 1D array free(ptr); prototype for freeing a 1D array for(i=0; in; i++){ free(ptr[i]); } how to free a 2D array namespace provides a method fro preventing name conflicts in projects .eof() function to determine if the file is at its end .good() function to determine if the file was read all right setw(n) sets a minimum print field width of size n for the next value output fixed displays floating-point numbers in fixed point form showpoint causes a decimal point and trailing zeros to be displayed for floating point numbers, even if there is no fractional part setprecision(n) sets the maximum number of digits in the number double num = 3.7; int val; val = (int) num; c style casting val = static_castint(num); c++ style casting const is an actual variable with a memory location, const must be given a value when declaring it; #define is not a variable, and instead is a preprocessor directive(text substitutive), #define must be given a value when creating differences between const and #define

Show more Read less
Institution
CPSC 1020
Course
CPSC 1020








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CPSC 1020
Course
CPSC 1020

Document information

Uploaded on
June 19, 2023
Number of pages
4
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
EXAMSTUDYPLUG Stanford University
Follow You need to be logged in order to follow users or courses
Sold
365
Member since
3 year
Number of followers
107
Documents
20575
Last sold
6 days ago
GRADE BUDDY

Welcome to My Page! Are you looking for high-quality study resources to ace your exams or better understand your coursework? You've come to the right place! I'm passionate about sharing my knowledge and helping students succeed academically. Here, you'll find a wide range of well-organized notes, study guides, and helpful materials across various subjects, including Maths ,nursig, Biology, History, etc.. Each resource is carefully crafted with detailed explanations, clear examples, and relevant key points to help simplify complex concepts. Whether you're preparing for a test, reviewing lectures, or need extra support, my resources are designed to make your learning experience smoother and more effective. Let me be a part of your academic journey, and feel free to reach out if you have any questions or need personalized assistance!

Read more Read less
4.5

239 reviews

5
161
4
51
3
15
2
5
1
7

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions