thanks....
I worked it out.
But I have a function that gives me the intersection of 2 vectors. But I dont know the return types of this function.
I want to pass the value returned by the...
Type: Posts; User: satty
thanks....
I worked it out.
But I have a function that gives me the intersection of 2 vectors. But I dont know the return types of this function.
I want to pass the value returned by the...
in this particular case, if 5 is not in the first column then make it the first entry and the associated value the secon
the the file will look like
1 4
2 3
3 2
4 5
1 4
2 3
I am able to read my file using the vectors as
vector<int> v1;
vector<int> v2;
vector<int> v(30);
vector<int>::iterator it;
fp = fopen("10_1.txt","r"); ...
Hello!
I wanted to use vectors to read my input text file.
I dont know what is going wrong in the code.
Can anyone comment?
thanks
#include <stdio.h>
#include <stdlib.h>
#include...
Hello!
Thanks a lot andruli .I sorted it out n it worked.
thanks again :)
Thanks for all the help till now.
I am almost through the code. (no warnings/ no errors)
But i got stops at
if (goal == queue->info )
while my my delete and insert queue function fine too.......
hey! This is the recent improvement i made.
When i compile I get the following errors:
A.c: In function 'Insert_Queue':
A.c: warning: assignment makes integer from pointer without a cast
A.c:...
My find function should give the adjacent nodes for the start nodes.
like
struct mainList *find_node( int value)
{
struct mainList *ptr = *pHead;
struct adjList *ptr2 = NULL;
...
struct mainList *find_node( int value)
{
struct mainList *ptr = *pHead;
while(ptr != NULL)
{
if(value == ptr->nodeNum)
{
printf("The starting node is : %d \n",...
Hey andruli,
It was a segmentation error that i fixed but I think my find node function is not working . I was using the pseudo code u helped with.
This function finds the node that has value...
Ya I checked....
I wanted to know if my code line
if ( goal == search1->nodeNum)
is incorrect...coz m getting error when i try to run my program
thanks
thanks i did that n found that I have an error in my delete function.
when i free one of the values.
but why so, i dont understand........can some1 comment?
struct Q * Delete_Queue(struct...
hello!
My program compiles but i get an error like
per(1711) malloc: *** error for object 0x100300670: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug...
Hello anduril462 .Thanks a lot till now. I tried the above template to implement in my code but something is really messing up things.
Firstly I have initialized a member in mainList called int...
Sure! I tried using Flag thingi but I did it well from wahtever I read n all
the strucutres that I am using for main list and adjacecny list are
// Adjacency List Structure
struct...
hey!
I am doing something like this
I made a structure and queues : to insert ans delete
struct Q
{
int info;
struct Q *next;
};
Hey!
Firstly you need to allocate memory for the values. And this is bot the right way to work with with 2 dimensional arrays.
Read Dynamic allocation of memory!
something like
Something...
hello!
I tried something like this and it worked but i guess it is not an appropriate way to go
void SearchAndPrintList(int value, int value2)
{
int i;
//int array = malloc(20)
i did something like this but it keeps on adding the node till segmentation fault.
void SearchAndPrintList(int value, int value2)
{
struct mainList *ptr = *pHead;
struct adjList *ptr2 =...
only the last issue.
I have trying to print the adjacent nodes on a user input node value.
void SearchAndPrintList(int value)
{
struct mainList *ptr = *pHead;
struct adjList *ptr2 =...
Thanks a ton.
i got it and it worked perfectly nice.
This forum is awesome :)
hey thanks, I used sscanf...it was easy n convinent.
I could make the adajceny list...
but got another error in my print function i guess.
I gives me two values now like
123 -> 111 0.000000 ...
hey !
I figured out it wont work for me become I have different functions that make adjacency list.
But
when i parse the lines...
it goes till the end of the line while(*line != '\0')
and...
thanks all.
let me try that.
i don't think that makes much different because I have latter written parsing codes for all three columns. First column act as main list and other two ad as the adjacency list.
but something went...