Advanced C Programming

Fall 2017 :: ECE 264 :: Purdue University

This is for Fall 2017 (4 years ago) only.


This syllabus applies to sections 2 (Quinn) and 3 (Lu).  For section 1 (Koh), only the part labelled “homework” applies.
Prerequisites CS 15900 with a minimum grade of C-
Textbook Computer Science: A Structured Programming Approach Using C (3rd Edition) by Behrouz A. Forouzan (ISBN 9780534491321)

We will direct you to the appropriate sections of the book so that you can prepare for class and strengthen your understanding of concepts and practical issues. However, this course is about “Advanced C Programming” (a verb), not “The C Language” (a noun). As such, the foundation of your learning will come from practice. If you are good at finding resources online, you may be able to get through the course without purchasing the textbook, depending on your learning style. No assignments will directly depend your having access to the textbook.

Learning objectives This course is designed to ensure that every student who passes will have mastered the following learning objectives:
  1. an ability to read and write C programs that use recursion
  2. an ability to read and write C programs that use structures
  3. an ability to read and write C programs that use dynamic data structures
  4. an ability to read and write C programs that use files

These learning objectives form the backbone for the content in this course. However, they do not pose an additional requirement for passing. Grades are determined solely by the formula in the section below.

Course grades will be based on the following proportions: 50% exams + 50% homework, with an additional minimum homework score for each grade level.

All exams (including the final) and homework will be equally weighted, unless otherwise announced. Some homework may be designated as “exercises” leading up to a larger “assignment”. In those cases, each of the exercises will be worth ¼ as much as the associated assignment. Exercises will be marked “(E)”. Assignments will be marked "(A)".

Assignment of + and - grades, and opportunities for bonus/participation points will be determined by each instructor.
Quizzes If your instructor gives quizzes, they may be given during any regular meeting of the class, with or without prior notice. You are responsible for attending every class, and staying current with the material covered so far.

Students are expected to be present for every meeting of the classes in which they are enrolled. Only the instructor can excuse a student from a course requirement or responsibility. When conflicts or absences can be anticipated, such as for many University sponsored activities and religious observations, the student should inform the instructor of the situation as far in advance as possible…For unanticipated or emergency absences when advance notification to an instructor is not possible, the student should contact the instructor as soon as possible by email, or by contacting the main office that offers the course. When the student is unable to make direct contact with the instructor and is unable to leave word with the instructor’s department because of circumstances beyond the student’s control, and in cases of bereavement, the student or the student’s representative should contact the Office of the Dean of Students.

Bring the course reference sheet with you to every class.

Email The course staff are here to help you become a great C programmer. We will provide help with general questions during lab hours, instructor office hours, and via the Piazza forum. Do not send general questions by email to the TAs or to the instructor. This is so students with similar questions can have the best chance at benefiting from your question and the answer. If we answer the same question repeatedly to different students, it takes time away from new, different questions, and also poses a risk that we might give slightly different answers and create confusion. General questions sent by email will either receive no reply or else a canned reply reminding you of this policy.

If you have questions of a personal nature that apply only to you, or require confidentiality, feel free to send email to the instructor, come to office hours, or schedule an appointment to speak at another time.


There will be approximately one programming assignment per week. To fetch the starter files (if any), you will run the command 264get hw05 (or likewise for the other assignments) from To submit, you will type 264submit hw05 hw05.c (or likewise).

Late work. Deadlines are at 11:59:59 PM according to the clock on, unless otherwise announced. Due to the number of people taking the class, deadlines must be strictly enforced. Homework submitted up to 24 hours late will be subject to a penalty of 30% of the total possible points. 24-72 hours late will be subject to penalty of 50% of the total possible points. 72-120 hours late will be subject to a penalty of 70% of the total possible points.

Compiler warnings. Code that causes compiler warnings with compiled using gcc v6.1.0 (64-bit Linux) with the flags -g -std=c99 -Wall -Wshadow -Wvla -Werror -pedantic. on ecegrid will be subject to a penalty of 40% of the total possible points.

Memory errors. Code that contains memory problems reportable by Valgrind will be subject to a penalty of 40% of the total possible points.

Code quality. Code that violates the code quality guidelines may be penalized 1% of the possible points per rule violated (any number of times).

Automated testers. For some assignments, we may enable automated testing prior to submission, to give you some early warning if it seems that your own testing was inadequate. These do not take the place of your own testing, and will generally not show the full detail about what test failed. Also, they may not include every test that will be used to score submissions. We may add more later, if we discover flaws in some student submissions that were not covered by the tester. Your job is to meet the assignment specification.

Multiple submissions. Your score will be based on the maximum of the following:
  • Score of latest submission as of the deadline.
  • Score of latest submission as of 24 hours after the deadline, minus 30% of the points possible.
  • Score of latest submission as of 72 hours after the deadline, minus 50% of the points possible.
  • Score of latest submission as of 120 hours after the deadline, minus 70% of the points possible.
Exceptions may occasionally be announced by the instructor prior to the deadline, such as for assignments that are to be human-graded.

You are encouraged to submit as often as you wish, even if your solution is incomplete. Submitting an incomplete solution increases the chance of receiving some points, in case you run into trouble later on. Also, every submission is backed up, so that we can help you in case of a disaster.

Partial credit. Where practical, partial credit will be given for submissions that meet the base requirements (below), and pass some but not all of our tests.

Base requirements. The following requirements apply to all assignments (where applicable), and are in addition to the requirements given in the assignment description.

  1. All required files must be included in a single submission.
  2. All required files must be named exactly as specified in the assignment description.
  3. Code can be compiled (as is) on ecegrid with gcc v6.1.0 (64-bit Linux) and the following parameters: -g -std=c99 -Wall -Wshadow -Wvla -Werror -pedantic.
  4. Code can run on ecegrid well enough to be tested.
  5. Code finishes in a reasonable amount of time (e.g., 2.0 seconds for most assignments)
  6. Function signatures and data types match the specification in the assignment description
  7. Any main(…) function must return EXIT_SUCCESS.
  8. Code follows our policy on academic integrity.

Any submission not meeting any of these eight base requirements will receive zero credit.

Homework bug bounty
Section 2 (Quinn) only

The homework bug bounty applies only to Section 2 (Quinn).

For new or revised homework assignments, there may be unintended issues (e.g., ambiguities, inconsistencies, typos, etc.). Therefore, we are asking for your help in identifying issues with new assignments early.

The first person to find an report a significant issue—i.e., ambiguity, inconsistency, impossibility, or typos that substantially obscures the meaning—in a homework assignment will receive 1 participation point. Exceptionally insightful discoveries might receive 2 points.

You must post a message to the Piazza forum with EXACTLY this subject:

description - [possible issue in HW##]

You must also send your instructor an email with that subject line and a direct link to your post on Piazza. This is for tracking, and you will not receive a reply to the email. Response will be via Piazza only.

The instructor reserves the right to determine what constitutes “significant”, “first”, and ”exceptionally insightful”, and to limit the number of points per person per assignment. In other words, please don't spam the board with philosophizing about the meaning of words or silly stuff, but if you find something that might confuse your classmates, call it out.

C language standard We are using the C99 (ISO/IEC 9899:1999) version of the C language, as compiled by gcc v6.1.0 (64-bit Linux) with the flags -g -std=c99 -Wall -Wshadow -Wvla -Werror -pedantic.
Regrades If we have made a mistake on the scoring of any assignment, quiz, or exam, please submit a regrade request form to the instructor within 2 weeks of the date the score was returned to you. We will do our best to rectify any bona fide mistakes that are reported in this timeframe. Regrade requests are not an opportunity to negotiate grades or exceptions to policies. TAs are not authorized to discuss regrades.
Changes This syllabus is subject to change. In particular, homework contents, deadlines, and exam dates—may be changed without notice up to 1 week in advance. Homework weights may be adjusted at any time, to reflect the relative difficulty of the assignments. The grading scale cutoffs might be adjusted at any time, but any change between the beginning and end of the semester will be in students' favor. Other changes to course policies may be made to ensure the integrity of the course, to ensure fairness to students, or as otherwise deemed necessary by the instructor.

All exams and quizzes are open-book, unless your instructor announces otherwise.

The exams and/or quizzes of the sections might be different. Although the learning objectives and most content will be the same, there may be some variation in timing, teaching style, and emphasis, making it more fair and effective to use separate exams.


  • Bring photo ID.
  • Bathroom breaks are not allowed. Please go before the exam.
  • Photographs or video recordings may be taken by course staff to document who was present.
  • If you finish early and wish to leave, please be courteous and leave very quietly.
  • The following items may be kept with you: pens, pencils, erasers (small, non-electronic), clear bottle of water with no label, analog watch (non-digital).
  • The following items must be left ≥5 feet (1½ meters) from you or any student: bags, backpacks, purses, phone, laptop, smart watch, calculator, digital watch, any other student's exam.

Electronic devices

Cell phones must be turned off or placed in silent mode—not vibrate—in your bag ≥5 feet (1½ meters) from you or any student, or else left at home.

Using or looking at any electronic device during an exam may result in immediate ejection from the exam, even if there is no evidence that you were using it to cheat. This is because we cannot accurately determine what was on the device (or other item).


pens, pencils, erasers (small, non-electronic)
clear bottle of water with no label
analog watch (not digital)
notes, reference sheet(s)*
textbook, other book(s)*
bags, backpacks, purses
phone, laptop, smart watch
digital watch
any other student's exam
* Notes, reference sheets, and books will be prohibited for any quiz/exam declared “closed-book”.
Academic integrity


The vast majority of students at Purdue do their work honestly and with integrity. The value of their grades and their ultimate degree is based on the expectation that earning a good grade always requires learning the material well, and demonstrating that in a way that can be measured (e.g., exams and assignments). Those who cheat are eroding that value, the reputation of Purdue, and ultimately the value of your diploma.

Cheating is unfair to those who do their work honestly, and even to the few who do not. It defeats the purpose of being a student at Purdue. It also defeats our dual purpose as instructors in this course: (1) to teach you advanced C programming, and (2) to ensure that a good grade in ECE 264 is a dependable indicator of true proficiency in advanced C programming. If students are able to cheat, we have failed at both of those goals. For all of these reasons, we have a very strict stance against cheating.


For purposes of defining cheating for this course, the following definitions apply:

  • “Copying” means reproducing any kind of data (including code, text, etc.) by any means (including copy-paste, copying files, hand-typing, etc.) from one source to another.
  • “Trivial modifications” – include differences in whitespace, variable names, function order, or other changes that affect the appearance but not the function or intellectual content of the material.
  • “Attribution” means explicitly acknowledging the source of copied content with a comment in exactly this format: /* Credit: <author>, <description>, <url_or_location> */.
  • “Authorized sources” include:
    • code that you have written yourself
    • starter code for assignments retrieved using 264get
    • names of C standard library functions (e.g., printf(…)) and keywords (e.g., #include)
    • any other source explicitly allowed by the instructor (with attribution).
  • “Unauthorized sources” include any of the following (unless explicitly allowed):
    • code from Stackoverflow, Wikipedia, or any other web site
    • code from the textbook or any other book
    • test cases given in assignment descriptions
    • any other source that is not an authorized source
  • “Unauthorized aid” means any resource that provides information or functionality relevant to a quiz or exam that was not explicitly allowed by the instructor. Unauthorized aids include:
    • hidden note sheets (on a closed-book exam or quiz)
    • other students' papers
    • calculator
    • watch
    • any other resource not explicitly allowed
  • “Cheating” includes doing—or attempting to do—any of the following:
    • Copying any amount of code from another students' code, the web, a book, or any other unauthorized source, even if you change the variable names or rearrange expressions or lines of code. You may use code from the course reference sheet or code that you wrote yourself.
    • Allowing another student to copy your code
    • Using any resource on any quiz or exam that is not explicitly allowed
    • Using unauthorized means to access exam contents.
    • Using unauthorized means to alter or affect grades, submission timestamps, or submission contents, or anything else that might affect grades.

Be careful not to reveal your code to others inadvertently. It is your responsibility to log out when you leave, and guard any printed copies of your work. If we discover two assignment submissions that are identical or very similar, both may be penalized.

Gray areas

Sharing abstract ideas about homework assignments—without code—is allowed, though we expect you to use good judgment. For example, standing together at a whiteboard and discussing a problem with spoken words and diagrams is allowed. Of course, in some cases sharing too much may deprive other students of the opportunity to learn and develop their problem-solving abilities. We leave this middle ground to your discretion.

Learning from code on the web or other sources is allowed, as long as you do not copy it by any means (including looking and typing it). Again, learning abstract ideas is allowed, though you should use good judgment to ensure that you learn how to solve programming problems.

Very generic code snippets (e.g., #include <stdio.h>) and the names of library functions should not require any copying. You should know those from memory.


Very minor instances (e.g., 1-3 lines of code from the web on a homework) will result in a score of zero for the affected assignment. All other instances will result in an "F" in the course, and a referral to the Office of Student Rights and Responsibilities.

How to report cheating

We encourage you to report any cheating you see or hear about to the instructor. You may do so in person, by email, or anonymously (e.g., non-Purdue email address that does not identify you, note under door, etc.). In doing so, you will be improving the fairness for the entire class, while also teaching the individual(s) a valuable lesson.

Even if you do not wish to name an individual, we welcome any feedback you may have about how we can ensure fairness and integrity in this course.

Late registration

Students who register late must do all of the same assignments. If you register after any assignment is due, or less than 2 days before the deadline, you may request an extension by providing proof of the late registration to the instructor. The extension is not automatic.

Grief Absence Purdue University recognizes that a time of bereavement is very difficult for a student. The University therefore provides the following rights to students facing the loss of a family member through the Grief Absence Policy for Students (GAPS). GAPS Policy: Students will be excused for funeral leave and given the opportunity to earn equivalent credit and to demonstrate evidence of meeting the learning outcomes for misses assignments or assessments in the event of the death of a member of the student’s family.
Violent behavior Purdue University is committed to providing a safe and secure campus environment for members of the university community. Purdue strives to create an educational environment for students and a work environment for employees that promote educational and career goals. Violent Behavior impedes such goals. Therefore, Violent Behavior is prohibited in or on any University Facility or while participating in any university activity.

Purdue University is required to respond to the needs of the students with disabilities as outlined in both the Rehabilitation Act of 1973 and the Americans with Disabilities Act of 1990 through the provision of auxiliary aids and services that allow a student with a disability to fully access and participate in the programs, services, and activities at Purdue University.

If you have a disability that requires special academic accommodation, please make an appointment to speak with me during the first week of the semester in order to discuss any adjustments. It is important that we talk about this at the beginning of the semester. It is the student's responsibility to notify the Disability Resource Center of an impairment/condition that may require accommodations and/or classroom modifications.

Emergencies In the event of a major campus emergency, course requirements, deadlines and grading percentages are subject to changes that may be necessitated by a revised semester calendar or other circumstances beyond the instructor’s control. Relevant changes to this course will be posted onto the course website and/or sent by email to the Purdue email address ( of students registered in this course. You are expected to read your Purdue email on a frequent basis.

Purdue University is committed to maintaining a community which recognizes and values the inherent worth and dignity of every person; fosters tolerance, sensitivity, understanding, and mutual respect among its members; and encourages each individual to strive to reach his or her own potential. In pursuit of its goal of academic excellence, the University seeks to develop and nurture diversity. The University believes that diversity among its many members strengthens the institution, stimulates creativity, promotes the exchange of ideas, and enriches campus life.

Purdue University prohibits discrimination against any member of the University community on the basis of race, religion, color, sex, age, national origin or ancestry, genetic information, marital status, parental status, sexual orientation, gender identity and expression, disability, or status as a veteran. The University will conduct its programs, services and activities consistent with applicable federal, state and local laws, regulations and orders and in conformance with the procedures and limitations as set forth in Executive Memorandum No. D-1, which provides specific contractual rights and remedies. Any student who believes they have been discriminated against may visit to submit a complaint to the Office of Institutional Equity. Information may be reported anonymously.


Among the materials that may be protected by copyright law are the lectures, reference sheet, this web site, assignments, quizzes, exams, and other material presented in class or as part of the course. Always assume the materials presented by an instructor are protected by copyright unless the instructor has stated otherwise. Students enrolled in, and authorized visitors to, Purdue University courses are permitted to take notes, which they may use for individual/group study or for other non-commercial purposes reasonably arising from enrollment in the course during the semester in which the student was enrolled.

Notes taken in class are, however, generally considered to be “derivative works” of the instructor’s presentations and materials, and they are thus subject to the instructor’s copyright in such presentations and materials. No individual is permitted to sell or otherwise barter notes, either to other students or to any commercial concern, for a course without the express written permission of the course instructor. To obtain permission to sell or barter notes, the individual wishing to sell or barter the notes must be registered in the course or must be an approved visitor to the class. Course instructors may choose to grant or not grant such permission at their own discretion, and may require a review of the notes prior to their being sold or bartered. If they do grant such permission, they may revoke it at any time, if they so choose.

// Credit: A substantial portion of this policy document is derived from a template authored by the Purdue Center for Instructional Excellence.


8/31/2017 Added links to the Piazza forum.
9/13/2017 Clarified that "exercises" may be marked "(E)" and assignments marked "(A)".