Sign in to follow this  

Two compilers, two different outputs

This topic is 4401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an identical function in two different programs which writes some text to a file. When I execute the function in VC++ 6.0 and look at file that is generated everything is as it should be. When I execute the function in VC++ .NET and look at the file a ton of garbage has been added. What is .NET doing in terms of writing to file that would make the outputs so different?? Here is a fragment of the code which writes some of the info to a file. It should be noted that 'title' is a char* not a std::string
	if(title != NULL)
	{	// if there is a title then write the info to the file 
			// Before the page is searched for key words write some other info to the file
		pFile << "	<LI> <OBJECT type=\"text/sitemap\">" << endl;
		pFile << "		<param name=\"Name\" "<< "value=\"" << title << "\">" << endl;
		pFile << "		</OBJECT>" << endl;
	}


Share this post


Link to post
Share on other sites
Can you tell us the exact differences? I suspect it could have something to do with you using:
"	"
instead of "\t".

Share this post


Link to post
Share on other sites
That doesn't appear to be enough of a code sample to reproduce the problem. For example, your definition and initialization of the pFile.

Share this post


Link to post
Share on other sites
Sign in to follow this