0

Hello everyone.
I'm having quite a rough time with my program because my code isnt just working

#include <string>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <windows.h>
using namespace std;
#include "DBase.h"
#include "Client.h"
list <Client> l;
DBase *example;
int main (void)
{

  string user= "my username";
  string pass = "my pass";
  string db = "my database ip"; 
try {
    cout << "Connecting..." << endl;
    example = new DBase (user, pass, db);
  
	cout<<"Connectiong Successful!"<<endl;

l = example->readClients();
cout << setw(5) << "COD" << " | "  
<< setw(12) << "NAME" << "         | "
<< setw(6) << "NUMBER ID" << "    | "
<< setw(14) << "ADRESS" << "       | " << endl;
for (list<Client>::iterator it = l.begin(); it != l.end(); it++)
cout << *it;
cout << endl;
   
    cout << "Closing" << endl;
  }
catch (SQLException error) {
    cerr << "Error: " << error.getMessage () << endl;
  }
cin.get();
return 0;
}

I keep getting this error:

Unhandled exception at 0x5e217a8b (msvcp90d.dll) in Teste.exe: 0xC0000005: Access violation reading location 0xcccccccc.

If someone could help me out I'd be really grateful.
Thank you in advanced.

Edited by Diogo Martinho: n/a

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by Narue
0

Access violation reading location 0xcccccccc.

Look for an uninitialized local variable in your debugger.

0

All my local variable are initialized though..

Then you must be imagining the error. :icon_rolleyes:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.