Question: I have a multi-line ASCII string coming from some (Windows/UNIX/...) system. Now, I know about differences in newline character in Windows and UNIX (CR-LF / LF) and I want to parse this string on both (CR and LF) characters to detect which newline character(s) is used in this string, so I need to know what "\n" in VS6 C++ means.

My question is if I write a peace of code in Visual Studio 6 for Windows:

```
bool FindNewline (string & inputString) {
    size_t found;
    found = inputString.find ("\n");
    return (found != string::npos ? true : false);
}

```

does this searches for CR+LF or only LF? Should I put "\r\n" or compiler interprets "\n" like CR+LF?

Answer: 
If your program is single-threaded, your `Random` should be a class member (`static`). This is a bit more efficient. It is even more important when using a `SecureRandom`, which can take a relatively long time to seed initially.

If multiple threads will end up calling `methodGetsCalledQuiteOften()`, the issue is a bit more complicated. The class is thread-safe, but the overhead required to protect its state during concurrent changes might be comparable to making new, independent instances of `Random`.

I'd probably stick with a `static` member until I noticed a lot of contention among threads for the random number generator, which is likely to never happen.
Benefits of static variables (main points):

1. Constants can be defined without taking additional memory (one for each class).
2. Constants can be accessed without an instantiation of the class.

Benefits of static methods:

Instance-independent behavior can be defined without fear of accidental interaction with an instance of the class.