Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:12:11+00:00 2026-05-27T17:12:11+00:00

What is wrong in this source code? #include <iostream> #include <ostream> #include <fstream> void

  • 0

What is wrong in this source code?

#include <iostream>
#include <ostream>
#include <fstream>

void printTest ( std::ostream * o )
{
    *o << "test" << std::endl;
}


int main ( int argc, char * argv[] )
{
  std::ostream * o = &std::cout;
  char ot[4096];
  strcpy ( ot, "test.txt" );
  strcat ( ot, ".log" );
  static std::ofstream of ( ot );
  printTest ( o );  //Print to console OK
  o = & of;
  printTest ( o );  //Print to file: CodeGuard stops the application with the error log
  return 0;
}

I tried to compile this source code under CBuilder 2010 (enabled CodeGuard). The application has been stopped by CodeGuard with the following error log:

25.12.2011 13:00:57 started a CodeGuard(tm) process: Project3.exe(2244)  
Bad parameter in process: Project3.exe(2244)  - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/fstream#55
A bad file or pipe stream (0x32AF36D4) has been passed to the function.
0x0040A150 Call to fputc(0x74 ['t'], 0x32AF36D4)
0x004098A5 - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/fstream#55
0x004081BE - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/fstream#246
0x00407E2B - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#465
0x004020AD - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#151
0x00401434 - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/ostream#683
0x00401276 - File3.cpp#13
Pointer arithmetic underrun in process: Project3.exe(2244)  - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#207
0x00892501-512, that is at offset 1-512 in heap block 0x00892500 (size 512).
0x0040985E - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#207
0x00408127 - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/fstream#237
0x00407E2B - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#465
0x004020AD - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/streambuf#151
0x00401434 - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware/ostream#683
0x00401276 - File3.cpp#13
The memory block (0x008922F0) [size: 512 bytes] was allocated with calloc
0x32A9D14F
0x004057B7 - c:\program files\embarcadero\rad studio\7.0\include\dinkumware\xlocale#1289
0x00404DDA - c:\program files\embarcadero\rad studio\7.0\include\dinkumware\xlocale#1261
0x004041F1 - c:\program files\embarcadero\rad studio\7.0\include\dinkumware\xlocale#1268
0x00403395 - c:\program files\embarcadero\rad studio\7.0\include\dinkumware\xlocale#323
0x004022AB - c:\program files\embarcadero\rad studio\7.0\include\../include/dinkumware

Thanks for your help.

Updated question:

Unfortunately this is an older and reported bug:
http://www.borlandtalk.com/is-there-a-bug-in-codeguard–vt112810.html

Topic can be closed…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:12:12+00:00Added an answer on May 27, 2026 at 5:12 pm

    Try building your project by statically linking against the runtime. You can do that by unchecking the option below:

    C++ Builder 2007

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: #include<iostream> using namespace std; class sample { int a; int
Whats wrong with this code? -(void) drawRect:(CGRect) rect { CGContextRef c = UIGraphicsGetCurrentContext(); if
Right now I'm trying this: #include <stdio.h> int main(int argc, char *argv[]) { if
I have this WxWidgets test source code that compiles, and when run, it shows
What's wrong with this C# code? I tried to overload the + operator to
What is wrong with this code. The code is finding the javascript and debug1
Something must be wrong with this code right here: + (UIImage*)captureView:(UIView *)theView { UIGraphicsBeginImageContext(theView.frame.size);
Hi I am trying to use std::thread with G++. Here is my test code
Whats wrong with this picture? Model: validates_acceptance_of :terms_of_service, :on => :create, :accept => true,
whats wrong with this? anybody help me please.. if(stripos($nerde, $hf) !== false) && (stripos($nerde,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.