Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

strncpy() vs strncat()

Name: Anonymous 2008-07-05 17:26

Hey /prog/, I've just googled this and it returned a bunch of faggots complaining about buffer overflows.

My question is, as both functions seem to do the same thing, which one would you use?

The man page doesn't leave this clear either, it just says that strcpy zerofills the buffer.

Name: Anonymous 2008-07-08 14:48

>>54-55
Syntactic sugar isn't always a bad thing. You can also specify properties like this:

public class Error {
  public int LineNumber { get; protected set; }
}

which automatically generates getters and setters, then replace them with actual code later if needed. Reducing boring typing and boilerplate is nice.

Properties and methods also behave differently with respect to reflection, thus making it easier to build GUI tools such as DataGridView and PropertyGrid (granted, you could do this by marking getters and setters with attributes [does Java have those?]).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List