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: 
Use a static variable when the instance isn't expected to change or when you want to share it between instances.

```
private final static int SOME_CONSTANT=1;

```

is an example.

```
public class USA {
    private final static Map statesOfTheUnion = new HashMap();
    // etc
}

```

could be another. In the latter case, we don't expect that the states will change from instance to instance. Thus is makes no sense for each instance to have its own copy.
access to static resources is not thread safe. You might get weird/unpredictable results in a threaded environment.