Advanced C Programming

Autumn 2015 :: ECE 264 :: Purdue University

This is for Fall 2015 (8 years ago)

Course policies

Course grades will be based on homework, exams/quizzes, participation, and bonus points (if any). To determine your letter grade, we will calculate a summary score, S, as follows:
  • S = H/3 + E/3 + min(H, E)/3 + P/10 + B/10
  • H = "average of the homework scores weighted by difficulty"; H ∈ [0, 100]
  • E = 0.20*E1 + 0.25*E2 + 0.30*E3 + 0.25*Q; E ∈ [0, 100]
    • Q = “quiz average” = 10*Average(Q1, Q2, …, Qn); Qi ∈ [0, 10]; Q ∈ [0, 100]
    • E1 = “Exam 1 score”; E1 ∈ [0, 100]
    • E2 = “Exam 2 score”; E2 ∈ [0, 100]
    • E3 = “Exam 3 (final) score”; E3 ∈ [0, 100]
  • P = “participation score”; P ∈ [0, 10]
  • B = “bonus score”; B ∈ [0, 10]
Your letter grade is then found according to the following correspondence: S ≥ 93 ⇒ A+,   S ≥ 90 ⇒ A,   S ≥ 87 ⇒ A–,   S ≥ 83 ⇒ B+,   S ≥ 80 ⇒ B,   S ≥ 77 ⇒ B–,   S ≥ 73 ⇒ C+,   S ≥ 70 ⇒ C,   S ≥ 67 ⇒ C–,   S ≥ 63 ⇒ D+,   S ≥ 60 ⇒ D,   S ≥ 57 ⇒ D–,   S ≥ 0 ⇒ F. 

Participation scores will be 0 by default. Those who help other students in online discussions, participate actively in class, or contribute in other tangible ways may receive up to 10 points.

Quizzes Quizzes 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.
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

We will do our best to give you plenty of opportunities to prove your mastery of these. However, any student who fails to master all of these learning objectives may receive a failing grade.

Prerequisites CS 15900 with a minimum grade of C-

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 course discussion board. 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 hw5 (or likewise for the other assignments) from To submit, you will type 264submit hw5 hw5.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 with gcc -g -Wall -Wshadow --std=c99 --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.

Style. Code that contains violates the style guidelines listed in the course reference sheet may be subject to a penalty of 20% of the total possible points. (This may be checked by spot checking or automated means, for some, all, or none of the assignments, and for some, all, or none of the style rules.)

Partial credit. For assignments that offer automated testing of submissions, no other partial credit will be given unless otherwise specified. Your assignment is either done or it is not.

Multiple submissions. Only your last submission will be scored, unless the instructor announces otherwise (before or after the submission deadline).

Homework bug bounty

Since we are creating new homework assignments, some issues are inevitable. 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 blackboard with exactly this subject: "[possible issue in hw##]: description". 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.

If you reported significant issues before this policy was added (10/17/2015), you may receive the points if you send email to the instructor with exactly that subject line. The subject line must match that pattern exactly, so that I can search for them to count them up at the end of the semester.


A Book On C: Programming in C (4th edition) by Al Kelley (ISBN 9780201183993)

Note: 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 learning the craft of programming. Practically speaking, you will learn primarily by doing. If you are good at finding resources online, you may be able to get through the course without purchasing the textbook. No assignments will directly depend your having access to the textbook.

C language standard We are using the C99 (ISO/IEC 9899:1999) version of the C language standard with the gcc compiler, version 4.4.7 on the ecegrid server (Red Hat Linux, 64-bit). Code should be compiled compiled on ecegrid using the following flags: -g -Wall -Wshadow --std=c99 --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 7 calendar days of the date the score or feedback 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.
Exams The course staff may take photographs or video recordings during exams or quizzes to ensure the integrity of exams. Students who leave the room before the end of the exam may not re-enter. Bathroom breaks are not allowed. You must bring a government-issued ID card with you to every exam. All exams are closed-book, unless announced otherwise. That means no notes, books, or devices of any kind are allowed.
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, code from the course reference sheet (with attribution), or any other source explicitly allowed by the instructor (with attribution).
  • “Unauthorized sources” are any sources except authorized sources.
  • “Unauthorized aid” means any resource that provides information relevant to a quiz or exam that was not explicitly allowed by the instructor. Examples include hidden note sheets (on a closed-book exam), other students' papers, smartphone, calculator, etc.
  • “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 alter or affect grades, submission timestamps, or submission contents.

Be careful not to reveal your code to others. 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.

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

The penalty for cheating depends on the severity and how we discover it. Very minor instances (e.g., 1-3 lines of code from the web on a homework) will result in a penalty equal to 100% of the points possible. For all other instances, the penalty will be an "F" in the course, and a referral to the Office of Student Rights and Responsibilities.

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 for ECE 264 after any assignment is due, or less than 2 days before the deadline may request a deadline extension for that assignment 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.

// Credit: The regrade form is from Prof. Yung-Hsiang Lu.

9/2/2015Add sections: C language standard, Late registration, and Copyright; corrected the compiler options to match the options given in the .bashrc file provided with the first homework
9/14/2015Clarifications: 0 credit for code with compiler errors; 20% penalty for style violations will be based on Code Quality Standards; added multiple submissions section under homework; fixed typo in grading formula ("A" ⇒ "H")
9/28/2015Renamed "Corrections" to "Regrades", for clarity.
10/17/2015Added homework bug bounty.