How do you know how to loop over an array for (int i=0;... ? You didn't invent that code. You read it somewhere many years ago and have copied it over and over many times since then. Do you have a license for that code? The author you learned it from did not invent it either, was he violating a license? It wasn't even invented by Dennis Ritchie since he copied the idea from earlier languages.
My point is that trying to copyright basic snippets of code is just ridiculous, it's something lawyers have tried to force on programmers but it makes no sense. We would be completely unable to program at all if we listened to lawyers all the time.