Search Results

Search found 1 results on 1 pages for 'athomsfere'.

Page 1/1 | 1 

  • Different output between release and Debug

    - by AthomSfere
    I can't figure this one out. I have a c++ Application that works in Debug mode exactly as expected: #include "stdafx.h" #include <string> #include <Windows.h> #include <iostream> using namespace std; void truncateServer(std::string inString); int _tmain(int argc, char *argv[]) { char* server = argv[1]; truncateServer(server); } void truncateServer(std::string inString) { std::string server = ""; int whackCount = 0; for (unsigned int i = 0; i < inString.length(); i++) { char c = inString[i]; if (whackCount < 3) { if (c == '\\') whackCount++; else server += c; } } cout << server; } For example if I call the server I want via its UNC path \\serverName\Share\ in the debug it gives me exactly what I want: servername However, if I use the release build I get nothing: I deleted the release output folder, but the issue is exactly the same. I can only assume there is some other difference between the release and build applications that is exposing a major issue with my code? Or another difference between the outputs I need to account for. What do I need to do to get the expected output?

    Read the article

1