My professor reported me for copying off a past students' programming assignment, which I don't even have access to, for these two lines in the middle:

void write(void *data, int *length)
  char *filedata = new char[*length+1]; // the two lines in question
  strcpy(filedata, (char*)data);

I thought these two lines of code are fairly simple, as I have learned them in a previous class. I have to go to a formal hearing. Any thoughts on how I should proceed?

  • You may be able to collect some evidence by searching on-line and showing that the two lines are a common idiom. Aug 10, 2016 at 18:25
  • Did you copy these two lines of code from a document given to you during the class? If so, it would probably be fine to use this in your assignment. Your professor probably just didn't realise the other student had also copied from the course. Aug 11, 2016 at 3:37
  • If these two lines make the professor believe that you copied someone else's assignment, I must sincerely doubt his judgement. It is boilerplate code that would be written identical by programmers all over the world. Not that you should tell him that :-( If this was copied from a previous class, then his accusation is shown to be quite baseless.
    – gnasher729
    Aug 11, 2016 at 22:22


Browse other questions tagged .