- node *BuildGraph()
-
-
{
-
-
int range, vehicules, i, j, k;
-
-
char ch;
-
-
vehicule *V = NULL,
-
-
*E = NULL;
-
-
node *N = NULL;
-
-
//edge *NewEdge;
-
-
FILE *InputFile = fopen("data.txt", "r");
-
-
if(!InputFile)
-
-
ERROR("FILE COULD NOT BE OPENED");
-
-
else
-
-
{
-
-
fscanf(InputFile, "%d %d", &vehicules, &range);
-
-
for(i = 0; i < vehicules; i++)
-
-
{
-
-
fscanf(InputFile, "%d %d", &vehicules, &range);
-
-
for(k = 0; k < i; k++)
-
-
for(ch = getc(InputFile); ch != '\n'; ch = getc(InputFile))
-
-
V = CreatVehicule();
-
-
fscanf(InputFile, "%s %d %d", V->CarId, &V->x, &V->y);
-
-
N = InsertVehicule(N, V);
-
-
for(j = 0; j < vehicules; j++)
-
-
{
-
-
fseek(InputFile, 0, 0);
-
-
fscanf(InputFile, "%d %d", &vehicules, &range);
-
-
E = CreatVehicule();
-
-
fscanf(InputFile, "%s %d %d", E->CarId, E->x, E->y);
-
-
E->distance = Distance(V->x, V->y, E->x, E->y);
-
-
if(E->distance <= range)
-
-
{
-
-
N = InsertEdge(N, E);
-
-
}
-
-
}
-
-
//break;
-
-
}
-
-
}
-
-
fclose(InputFile);
-
-
return N;
-
-
}
-
-
am having those errors:
[size=1]First-chance exception at 0x10295db1 (msvcr90d.dll) : 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x10295db1 (msvcr90d.dll) : 0xC0000005: Access violation writing location 0x00000000.
[/size]
2 1475
Sounds to me like there is a pointer error going on. Either you are trying to access a pointer that has been freed, or that you are making a pointer point somewhere that hasn't been allocated. Check any part of your program that uses pointers, and make sure you aren't doing things like exceeding the bounds of an array or using it after a free() statement.
Have you stepped thgrougfh the code using your debugger???
If not, learn how to use the debugger. You can pinpoint the failure exactly.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lilith |
last post by:
Is there a python module somewhere (been searching today, no luck)
which has efficiently coded various graph-handling routines, such as
finding the shortest path through a graph, or the set of all...
|
by: Magnus Lie Hetland |
last post by:
Is there any interest in a (hypothetical) standard graph API (with
'graph' meaning a network, consisting of nodes and edges)? Yes, we
have the standard ways of implementing graphs through (e.g.)...
|
by: JD Kronicz |
last post by:
Hi .. I have an issue I have been beating my head against
the wall on for some time. I am trying to use late
binding for MS graph so that my end users don't have to
worry about having the right...
|
by: Arno R |
last post by:
Hi there,
I have a MsGraph-chart in my report.
I just want to display a graph for each record (just plain bars for a value each year,
nothing
fancy)
On one PC where only Access 97 is installed...
|
by: borekfm |
last post by:
Hitting two problems when running a new report I've created, that
contains a chart/graph. The chart shows three series, two are shown as
lines and one as an area. The data come from three different...
|
by: Jef Driesen |
last post by:
I'm working on an image segmentation algorithm. An essential part of the
algorithm is a graph to keep track of the connectivity between regions.
At the moment I have a working implementation, but...
|
by: kaosyeti via AccessMonster.com |
last post by:
i have a query that opens up into a very nice 3D bar graph with each verticle
bar ranging between 400 - 850 in value. the issue i have is that if you're
looking at the graph, the closest major...
|
by: Adrian |
last post by:
Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph
disappears immediately (after the last plot). Writing " " to a label, in
between subsequent plots, solves this problem....
|
by: Man4ish |
last post by:
namespace ve/////////////////ve.h
{
struct VertexProperties
{
std::size_t index;
boost::default_color_type color;
};
}...
|
by: Man4ish |
last post by:
I have created Graph object without vertex and edge property.It is working fine.
#include <boost/config.hpp>
#include <iostream>
#include <vector>
#include <string>
#include...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |