# Two compilers, two different outputs

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

## 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 on other sites
Can you tell us the exact differences? I suspect it could have something to do with you using:
"	"

##### 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.

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631739
• Total Posts
3001957
×