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 138171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:13:19+00:00 2026-05-11T07:13:19+00:00

Greetings everyone, going to need some help in clearing this exception. I get the

  • 0

Greetings everyone, going to need some help in clearing this exception.

I get the following when debugging my compiled program in Microsoft Visual C++ 6.0:

Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\tsappcmp.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found. First-chance exception in SA.exe: 0xC0000005: Access Violation. 

Here are the relevant screenshots from the debugger.

Showing ostream.h:

http://img237.imageshack.us/my.php?image=accessviolation.png’>http://img237.imageshack.us/img237/1116/accessviolation.th.png’ border=’0’/>

Showing main.ccp:

http://img509.imageshack.us/my.php?image=accessviolation2.png’>http://img509.imageshack.us/img509/3619/accessviolation2.th.png’ border=’0’/>

I’ve tried to scour my code for null pointers and have also tried to ignore the exception with no luck. Here are the three main components of my script:

main.ccp

#include <iostream>  #include 'SA.h'   using namespace std; // For the use of text generation in application   int main()  {     SimAnneal Go;      cout << 'Quadratic Function' << endl          << 'Solving method: Simulated Annealing' << endl;      cout << '\nSelect desired Initial Temperature:' << endl          << '> ';     cin >> Go.T_initial;      cout << '\nSelect desired number of Temperature Iterations:' << endl          << '> ';     cin >> Go.N_max;      cout << '\nSelect desired number of step Iterations:' << endl          << '> ';     cin >> Go.N_step;      cout << '\nSelect desired Absolute Temperature:' << endl          << '> ';     cin >> Go.T_abs;      Go.LoadCities();      Go.Initialize();      Go.SA();      system ('PAUSE');      return 0; } 

SA.h

    #ifndef SA_H     #define SA_H   class SimAnneal {          double S_order [15];                 double S_trial [15];                  int SwapNum1;         int SwapNum2;          double CityArray [15][15];          double E_initial;         double E_current;          double T;          void Metropolis (double, int, int);         void Next_State (double, int);         double Schedule (double, int);         double ObjFunction (double CityOrder []);          void EquateArray ();         void OrderInt ();         void OrderTrial ();         void OrderList (double array[]);          void WriteResults (double, double, double, double, double);        public:         int N_step;         int N_max;          double T_initial;         double T_abs;          void SA ();         void Initialize ();         void LoadCities ();     };       double Random_Number_Generator(double nHigh, double nLow);   #endif   

SA.cpp

#include <math.h> #include <iostream> #include <fstream>           #include <iterator> #include <iomanip> #include <time.h>            #include <cstdlib>            #include 'SA.h'  using namespace std;   void SimAnneal::SA()  {     T = T_initial;     E_current = E_initial;           for ( int N_temperatures = 1 ; N_temperatures <= N_max ; N_temperatures++ )         {             Metropolis(T, N_step, N_temperatures);             T = Schedule(T, N_temperatures);          if (T <= T_abs)             break;         }      cout << '\nResults:' << endl     << 'Distance> ' << E_current << endl     << 'Temperature> ' << T << endl;      OrderList(S_order); }  void SimAnneal::Metropolis(double T_current, int N_Steps, int N_temperatures) {     for ( int i=1; i <= N_step; i++ )                    Next_State(T_current, N_temperatures);       }  void SimAnneal::Next_State (double T_current, int i)  {     OrderTrial();      double EXP = 2.718281828;      double E_t = ObjFunction(S_trial);     double E_c = ObjFunction(S_order);      double deltaE = E_t - E_c;                                       if ( deltaE <= 0 )         {             EquateArray();         E_current = E_t;     }         else         {         double R = Random_Number_Generator(1,0);         double Ratio = 1-(float)i/(float)N_max;                  double ctrl_pram = pow(EXP, (-deltaE / T_current));              if (R < ctrl_pram*Ratio)                                     {                EquateArray();             E_current = E_t;         }         else              E_current = E_c;     } }  double SimAnneal::Schedule (double Temp, int i)  {     double CoolingRate = 0.9999;      return Temp *= CoolingRate;  }  double SimAnneal::ObjFunction (double CityOrder [])  {     int a, b;      double distance = 0;      for (int i = 0; i < 15 - 1; i++)     {         a =  CityOrder [i];         b =  CityOrder [i + 1];          distance += CityArray [a][b];     }      return distance; }  void SimAnneal::Initialize ()  {     int a, b;      double distance = 0;      OrderInt();      for (int i = 0; i < 15 -1; i++)     {         a =  S_order [i];         b =  S_order [i + 1];          distance += CityArray [a][b];     }      E_initial = distance; }  void SimAnneal::EquateArray ()  {     for (int i = 0; i < 15; i++)     {         S_order [i] = S_trial [i];     } }  void SimAnneal::OrderInt ()  {     for (int i = 0; i <15; i++)     {         S_order [i] = i;     } }  void SimAnneal::OrderTrial ()  {     for (int i = 0; i < 15; i++)     {         S_trial [i] = S_order [i];     }      SwapNum1 = (int)Random_Number_Generator(15, 0);              SwapNum2 = (int)Random_Number_Generator(15, 0);      for (int n = 0; n <= 100000; n++)                            {         SwapNum2 = (int)Random_Number_Generator(15, 0);           if ( SwapNum1 != SwapNum2 )             break;     }      S_trial [SwapNum1] = S_order [SwapNum2];     S_trial [SwapNum2] = S_order [SwapNum1]; }  void SimAnneal::OrderList (double array[])  {     cout << 'Array List : ' << endl;     for (int i = 0; i < 15; i++)     {         cout << ' > ' << array[i] << endl;     }      cout << 'End of array' << endl; }  void SimAnneal::LoadCities ()  {     int x, y;      for (y = 0; y < 15; y++)                         {             for (x = 0; x < 15; x++)                     {                   if (x == y)             {   CityArray[x][y] = 0.0;               }             else if (x != y)             {   CityArray[x][y] = Random_Number_Generator(7, 1);              }         }       }        for (y = 0; y < 15; y++)      {             for (x = 0; x < 15; x++)          {                   if (y > x)                 CityArray[y][x] = CityArray[x][y];         }       }   }  double Random_Number_Generator(double nHigh, double nLow) {     double fr = ((rand() % ((int)nHigh*1000 - (int)nLow*1000 + 1)) + nLow) / 1000;      return fr; } 

Any Assistance would be much appriciated. I’m all out of ideas myself.

  • 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. 2026-05-11T07:13:20+00:00Added an answer on May 11, 2026 at 7:13 am

    The code you posted wouldn’t even compile:

    1)

    cin >> Go.Write; 

    There’s no such variable in the SimAnneal class.

    2)

    Go.SA(Go.Write) 

    Your SA method doesn’t accept any parameters.

    Another thing is, why don’t you run your project in debug mode directly in VC++ 6.0? The VS on the screenshots is clearly 200*X*.

    According to the screenshots, you’re crashing on the line:

    cout << 'Quadratic Function' << endl      << 'Solving method: Simulated Annealing' << endl; 

    Which doesn’t make much sense, unless your output stream is mutilated in some way. Have you tried watching the console before the crash occurs?

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

Sidebar

Related Questions

Greetings everyone. I'm in need of some experiance here as how to deal with
Greetings everyone: I would love to get some information from a huge collection of
Greetings everyone. This is my first question here at stackoverflow so please bear with
Greetings everyone. Having an issue compiling my script containing the following function. Three errors
Greetings Everyone. I'm currently trying to compile a multiple-language program (C, C++ and FORTRAN)
Greetings everyone Using the request object, I can't get a sole value as in
Greetings, everyone. I'm trying to learn some Silverlight basics, and have decided to write
Greetings! I'm working on wrapping my head around LINQ. If I had some XML
Greetings, I need a way (either via C# or in a .bat file) to
Greetings! I am trying to check directory write-permissions from within a Windows MFC/ATL program

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.