added the deletes to fix that stuff.....
&u->data prints out 0 and u->data seg faults.... why?
I'm using gcc on a linux machine to compile, never used a debugger
Type: Posts; User: JJJIrish05
added the deletes to fix that stuff.....
&u->data prints out 0 and u->data seg faults.... why?
I'm using gcc on a linux machine to compile, never used a debugger
well thats pretty cruel..... thanks for the help you did give me
guess i'll hope someone else is willing to figure out why color[u->data]="gray"; is causing a seg fault, or i'll seek help...
- thats just ugly and more work than required and since its now almost 2 a.m. and i'm running on 2 hours of sleep definately feeling lazy :-P
- actually the assignment description says to call them...
i have extra couts in there to find the seg fault so you can just ignore them....
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
-multiple functions modifying them, so only way I know
-hw assignment and thats what they said to use, lol, its for an algorithms class so they know what they are supposed to be (pi=parent,...
u->data is causing a seg fault...... why?
in particular the first time i think it is used is in (where i know it is causing the seg fault)
color[u->data]="gray";
in DFS_Visit
any thoughts?
http://dwks.theprogrammingsite.com/myprogs/cfonline.htm
Yes, I want it to be an array of pointers (Nodes)..... How do I do that then?
Ah thanks! But
&graph[i]=NULL;
still gives the error:
Bit rusty with C++ and not sure how to fix these errors i'm getting. Any help is much appreciated!!!
Here's the errors:
DFS.cpp: In function 'void DFS(Node*)':
DFS.cpp:64: error: cannot...
well figured out the out of bounds error..... but the algorithm doesn't seem to work.... so gotta go figure that out :-P
thanks!
well if it is c99 why is it working?.... ya i assumed it was an out of bounds.... just struggling to find it....
they said C++.....
ok so it works now except one thing.....
The array before sorting: 4 3 2 1
The array after sorting: -708361232 1 2 3
trying to figure it out.... can anyone else spot it?
oh ya.... lol... 1 is supposed to be 0.... let me change that....
why do i have to use one of those? couple sites i've looked at said the way I did is the way to do it.... why shouldn't it work and how exactly do i declare it? int[] A = new int A[len] or something...
compiles fine for me using gcc.... so then how am i supposed to declare it?
why? is that not how you declare arrays in c++? It compiles fine and takes in the numbers and prints them out....
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
int operationsCounter=0;
void maxheapify(int A[], int i, int len)
I printed out the array before and after and it comes out the same.... (not sorted)
Ok so i'm writing a program to sort an array using heap sort. I have my main function that gets the information on what the array is, then using a function to sort it. The function is defined as:...
ok.... it compiles.... but it seems to be getting hung up somewhere and I can't figure out where..... any good programs to use to figure out where and why its getting hung up? Or anyone willing to...
ah..... well actually i did work those errors out.... but what are the system calls equivalent to fgets and fputs?
my code is rather long... is there a limit at how long of code we're allowed to post? should i just attach a file?
Error 1: backup.c:54: error: 'stdbackup' was not declared in this scope
stdbackup declaration: void stdbackup(char* origPath, char* backupPath)
call to stdbackup: stdbackup(dir_to_copy,...