There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

barsoap , (edited )

How on earth should a newcomer know that the letter “n” in that word stands for number without having to google it?

By looking at the difference between strcpy and strncpy. Preferably, though, you should simply learn C before writing C.

The gist of is is that strcpy takes a null-terminated string and copies it somewhere, while strncpy takes a zero-terminated string and copies it somewhere but will not write more than n bytes. strncpy literally has exactly one more parameter than strcpy, that being n, hence the name. If n is smaller than the string length (as in: distance to first null byte) then you’re bound to have garbage in your destination, and to check for that you have to dereference the pointer strncpy returns and check if it’s actually null. Yay C error handling.

In retrospect null-terminated strings were a mistake, but so were many other things, at some point you just have to accept that there’s hysterical raisins everywhere.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines