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: 
In terms of time and memory I can't think of any big advantages (the static variable will be part of the class definition rather than on the heap). However static variables are useful when you know there will be accesses to the object from multiple places. hvgotcodes is right though that using static resources is not thread-safe. But if your only reading the static value then using threads for it is fine.

It'll save you from having to pass references to the initiated object (A or B) into other object in order to use `random`
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.