2,180 Topics

Member Avatar for
Member Avatar for JLopeman

To any and everyone :) As stated in my title, this is a homework assignment, so I appreciate any help or suggestions that are given. Also, per the website rules, I have put effort to this, and I'm not asking anyone to just do my work. (The program compiles and …

Member Avatar for JLopeman
0
169
Member Avatar for RaDeuX

Okay, so my program is very close to completion. The only problem is that the program leaks memory. The deleteNode, deleteManager, and destroyList are the ones to blame, or so I think. When I delete a node other than the first one it works while leaking memory. However, when I …

Member Avatar for Salem
0
174
Member Avatar for supersabre

I am trying to create multiple trees after calling tree_holder. The number of tree is unknown until compile time. Since there are many trees, and i want to access them right away just like an array. I do not use linked list since it is too slow. I have written …

Member Avatar for supersabre
0
304
Member Avatar for namehere05

Ah right! Im on my first steps on c++, What Im trying to do is have this "basic node" class wich just take an id and from there usign inheritance make "linked list node" and "binary tree node" classes my code so far looks like this [CODE]void main() { sLink* …

Member Avatar for namehere05
0
113
Member Avatar for teddybouch

This one's got me really confused, but hopefully y'all will see something I can't for lack of experience and expertise. The following segment of code is part of a larger function that performs a Hough Transform on a series of coordinates to find lines described by the points. I'm looking …

Member Avatar for teddybouch
0
122
Member Avatar for teddybouch

I'm having trouble with passing a linked list between functions. I did some research online and found a few things, one of which was here, that led to the conclusion that I am not passing my linked list by reference. However, I have tried numerous different syntaxes to do this, …

Member Avatar for teddybouch
0
116
Member Avatar for christiangirl

I'm having trouble making this program with linked lists work. Where I am having a problem is in printarea() [code] //**************************************************************** // This program tests creating dynamic linked list of // several Dynamic (descendents) // It uses: shape1.h header file // Filename: prtshape.cpp //**************************************************************** #include <iomanip> #include <iostream> #include "shape1.h" …

Member Avatar for christiangirl
0
155
Member Avatar for T'Scoopz

I'm trying to make a linked list, what's wrong with my syntax for adding a node? [code=c] struct data { char name[20]; char number[10]; }; typedef struct node { struct data list; struct node* next; } Node; Node *head = 0; Node *tail = 0; Node *New = 0; void …

Member Avatar for William Hemsworth
0
93
Member Avatar for DemonGal711

Okay, I have to store an adjacency matrix for a graph problem I'm doing. Let's use this picture to explain it right now. [url=http://i21.photobucket.com/albums/b272/DemonGal711/Program%20Pic/pic.jpg]Click here[/url] I figured, I'm use a linked list to store it where each node uses the struct [code]struct Node { char item; Node* vertex; Node* next; …

Member Avatar for DemonGal711
0
182
Member Avatar for solimanmuttawa

this is a linked list assigment and the required from me is to fill the functions: i have one fucntion left that i was unable to do which is void DeleteElement(int ID); and i have another problem the compiler states that i hve o errors but when i compile the …

Member Avatar for Lerner
0
89
Member Avatar for redrevis

Hi guys. I'm having some right trouble at the moment. I posted on another tech forum and so far have received no help. So i thought i'd try over here. These are my posts from the other forum to get you up to speed with my problem. About a few …

Member Avatar for jholland1964
0
284
Member Avatar for elsa87

hi everyone..i really need help as fast as possible..i have 14 errors in the program..it is a linked list implementation for reversing a stack using recursion.. here is the code: [CODE]#include <iostream> using std::cin; using std::cout; using std::endl; #include<cstdlib> #include <fstream> using std::ifstream; using std::ofstream; #include"ItemType.h" using namespace std; struct …

Member Avatar for Salem
0
102
Member Avatar for DLightman

I am receiving the following compile errors: [CODE] BinarySearchTree.cpp:3: error: expected constructor, destructor, or type conversion before â<â token BinarySearchTree.cpp:9: error: expected initializer before â<â token BinarySearchTree.cpp:15: error: expected initializer before â<â token BinarySearchTree.cpp:21: error: expected initializer before â<â token [/CODE] Looking at my implementation, I fail to see the …

Member Avatar for DLightman
0
155
Member Avatar for solimanmuttawa

i am done with the main of the program but i have difficulty with several functions that need help if u please help me thank u very much #include <iostream> #include <string> using namespace std; void Output(struct Employee *data_ptr); void Input(struct Employee *data_ptr);void AddElement_Front(struct Employee E); void AddElement_End(struct Employee E); …

Member Avatar for ArkM
0
125
Member Avatar for LustrousWS6

I have googled the error and found nothing. This is the last bug I've been trying to work out and the only I haven't been able to figure out. Thank you for your time. I'm currently trying to test out a standard simple linked list class. I'm currently trying to …

Member Avatar for StuXYZ
0
99
Member Avatar for Ahmed_I

Generic Double Linked List [CODE="C++"]/* These are generic Functions for a Generic List * Note:-Only Functions not including a Menu and an Interface * You could use these Functions for your own Benefit*/ #include <iostream> using namespace std; template <class X> struct node{ //Template Structure X data; node* next; node* …

Member Avatar for ArkM
0
197
Member Avatar for emotionalone

I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent …

Member Avatar for cikara21
0
227
Member Avatar for NinjaLink

Hello, I'm having a simple problem. For my program, each song has an id number which stores the songs information. For my deleteSong function, I am asking the user what id of the song does he/she wants to be deleted. After the user enters the id of the song he/she …

Member Avatar for NinjaLink
0
148
Member Avatar for kyosuke0

whenever the clearMemory function is called i get a segmentation fault and i can not figure out whats wrong. The function is supposed to delete all pointers. The function brings in the pointer to the linked list by reference. The nodes in the list are structs i named bus that …

Member Avatar for rajenpandit
0
137
Member Avatar for number87

I am creating a linked list which links a struct of data together. However, this is my problem, if I declare struct Node first then the Event type wont exist, but if I declare struct Event first then nodePtr wont exist....im kinda stuck here as to how I should declare …

Member Avatar for number87
0
556
Member Avatar for starletcharmed

Hey! We have to write a function that deletes nodes from a linked list. I was wondering if you could tell me if this is correct, and if not, how I could fix it? [CODE]void delNeg(node * L) { node *cur = L; node *prev = NULL; while(cur != NULL) …

Member Avatar for cikara21
0
101
Member Avatar for Oblique

I am trying to create a Space Invaders sort of game. I am using a linked list for the bullets that the player shoots and in the same list, there is also the enemies. I have a addNewEnemy Function which I run once in the main game loop. This adds …

Member Avatar for emotionalone
0
130
Member Avatar for Terlington

Hi All, I'm actually making a little program but I'm encountering an error that I can't manage to resolve. So I have a linked list of "User" (each User has got a pointer to the previous User and another pointer to the next User). At First, the List is empty …

Member Avatar for Terlington
0
127
Member Avatar for NinjaLink

Hello. I am currently having problems. I am asking a user to input the position and number of where they would like to insert into the Linked List. After the user input the information, the number does not appear in the Linked List, but everything else does. Can someone help …

Member Avatar for paramdhingra
0
126
Member Avatar for NinjaLink

Hello. I'm having problems in 2 different functions: GetNth() and InsertNth() 1) For my GetNth() function, I want to take my linked list and an integer index and return the data value stored in the node at that index position. For example: {42,13,66}, the index of 1 should print out …

Member Avatar for NinjaLink
0
207
Member Avatar for Lokolo

Main.cpp This is where the problem lies. [code] #include <iostream> #include <time.h> #include <math.h> #include <iomanip> #include "LinkedList.h" #include <fstream> #include <string> using namespace std; void main(void) { LinkedList Customers; Customer* newCustomer; Entry* test; int i = 0; newCustomer = new Customer(1001, "Olly", "07/10/1988", "17 Bob Lane", "Hobbs Road", "UB3 …

Member Avatar for Lokolo
0
113
Member Avatar for NinjaLink

Hello. I'm having 2 difficulties... 1) I am trying to print out a string with spaces... Functions used: addSong and printSong For ex: (This is not the whole code...I'm pointing out the functions that it is used in) [CODE=Cplusplus] void addSong(mp3Type*& first, mp3Type*& last) { cout<<"Song title: "; cin>>songTitle; getline(cin,songTitle); …

Member Avatar for NinjaLink
0
214
Member Avatar for LevelSix

"Write a program to display a linked list graphically. Draw each element of the list as a box, and indicate the links with line segments. Draw an iterator as in Figure 15-3. Supply buttons to move the iterator and to add and remove elements." The elements of the node appear …

Member Avatar for quuba
1
2K
Member Avatar for RavUn

Hello, I know how to create a hash_map and use my hash function with it, but I don't know how to handle collisions. Specifically, how would I implement a chain/buckets with a linked list... it seems like it's built in but I can't find how to do it. [code] #include …

Member Avatar for RavUn
0
139
Member Avatar for iamdougsinbox

Hello everyone, This is my first post, I'm having trouble on an assignment. I'm writing a function for a database program in class... I have to write the function that will tranverse a linked list, add a "node" and then write the user entered info into the "node". The first …

Member Avatar for iamdougsinbox
0
100
Member Avatar for NinjaLink

This is my goal: - Search the list for a number and display how many times the number occur or display 'number not present' - Modify number and change each occurrence of a #, to the new number or display 'number not present' I have 2 functions. My first function …

Member Avatar for NinjaLink
0
203
Member Avatar for dampecram

Hello, I'm in the middle of writing a doubly linked list, I have the print in reverse working fine and my insert function working fine, I just can't seem to find what I'm doing wrong with the delete function.. WHen i try to delete the last letter in the node.. …

Member Avatar for devnar
0
181
Member Avatar for NinjaLink

Hello.. This is what my program is suppose to do: -find length of list -check for empty list -insert in back of list -delete from front of list [B]I have everything done except finding the length of list and check for empty list.[/B] I need help getting the length of …

Member Avatar for ArkM
0
3K
Member Avatar for starletcharmed

Hi, can anyone help me fix my code. This program is linked to a project list (with classes). This is the main program. It has to open up a file of strings and output then in order of how many there are. But its not working though. Can someone help …

Member Avatar for Ancient Dragon
0
113
Member Avatar for millanskie

Hi does anyone knows how to sort in link list, i already done some parts of it and its already working except for the sorting part. please help me about this sorting problem... [CODE]#include <stdio.h> #include <stdlib.h> struct nodeTag { int nData; struct nodeTag *pLink; }; typedef struct nodeTag structNodeType; …

Member Avatar for Narue
0
119
Member Avatar for DeadJustice

I can add a new node if the head is empty, but I can't attach a new node. Instead I get a null pointer error. Can anyone see what I'm doing wrong. I think I've been staring at this for too long. EDIT: Forgot to say I'm adding the Nodes …

Member Avatar for DeadJustice
0
1K
Member Avatar for jkun2

I have a project where i am having to create a doubly link list of persons, with lastname, firstname, and id number. Basically, how do I implement my compareTo method in my add method of dbl list ??? thanks in advance. Here is my person class: [code=java] public class Person …

Member Avatar for jkun2
0
132
Member Avatar for WesFox13

Hey all I've been writing a program that cheks an ISBN number as valid or invalid as an assignment for a class but I need a little bit of help. I get these errors when I try to compile it: error C2275: 'std::string' : illegal use of this type as …

Member Avatar for VernonDozier
0
97
Member Avatar for peachslasher

Hi guys I am trying to implement a buddy system using C, I've free the memory using myfree() and i've allocated memory using mymalloc(). I've tried to run the program, but it keep on generating segmentation error, would you guys please see the code, and tell me if you've spotted …

0
74
Member Avatar for Kanvas

HI i have a small problem but for some reason i can't think of how to do it. I'm making a linear linked list of arrays. The Array is of travel class object. So in the struct node, how should i implement so that the size of the array is …

Member Avatar for jencas
0
150
Member Avatar for Se7Olutionyg

[CODE=cplusplus]// CS 210 EDDIE CHEN // THIS IS PROGRAM 4 (ISBN-Check), a program that verifies ISBN. #include <iostream> #include <fstream> // REQUIRED FOR FILE STREAMS #include <cstdlib> // FOR DEFINITION OF EXIT_FAILURE #include <cctype> #include <string> using namespace std; // ASSOCIATE STREAMS WITH EXTERNAL FILE NAMES #define inFile "isbntest.txt" // …

Member Avatar for Ancient Dragon
0
184
Member Avatar for JackDurden

Im having trouble turning this function into a recursion function, partly because I did it another way and now I cant think of how to do it recursively. Can you help? [CODE]int list::recursion(int item, int position) { node* temp = startPtr; while(temp != NULL) { if(temp->item == item) return position; …

Member Avatar for skatamatic
0
105
Member Avatar for scl84

Hi! I want to know if it is possible to display a binary tree using double linked list as follows: A / \ B C / \ / D E F I tried some possibilities but i think it is impossible since there are lots of parameters to take in …

Member Avatar for Prabakar
0
88
Member Avatar for m_arian

Hi I'm new to coding. Can someone please help with a linked list problem. I'm getting numbers for output, I think they are addresses. The output I'm getting is: HEAD CODE -12086434400 1080131584 TAIL CODE The output I need is: HEAD CODE <rect x="0" y="0" width ="200" height="200" stroke-width="2" stroke="red" …

Member Avatar for Prabakar
0
112
Member Avatar for djhello

Write a program that implements an address book for your friends using linked lists. Each person has name, last name, and phone number. Data should be stored in ordered based on last name. The program should include the following menu: 1.Add a friend 2.Delete a friend 3.List all friends with …

Member Avatar for c++ prog
0
101
Member Avatar for DemonGal711

Okay, I'm making a program that will let you traverse a maze where the beginning is the top right corner (coming from the right) and it ends in the bottom left corner (going to the right). We have a 2D array for the board and are using a stack to …

Member Avatar for stilllearning
0
130
Member Avatar for JustLearning

When I try to compile and run this file I get a segmentation fault when the size function is called so I must not have it set up right. The size function returns the number of stored chars in the queue. So I am thinking that the size function in …

Member Avatar for JustLearning
0
185
Member Avatar for mrboolf

Hi all. I am trying to overload the operator+ for a SLinkedList class I created. I would like to write [ICODE]list1 = list1 + list2;[/ICODE] and obtaining that list2 is merged into list1. I thought it was simple but it didn't worked properly. I tried to simplify the problem as …

Member Avatar for mrboolf
0
265
Member Avatar for Kanvas

how do you make a node of pointer of a device? (device is just a class that i made up, i need to use pointers in LL so i can "share" one object with multiple LLs) [code] struct node { device * devicePtr; node * left, * right, * next; …

Member Avatar for kux
0
244
Member Avatar for peachslasher

Hi guys, By any chance do any of you guys know any way to implement an array of linked list without using vector, since i need to implement an array of linked list using c and unfortunately vector library is unavailable. This is what i did: [code] Struct MyList{ int …

Member Avatar for peachslasher
0
141

The End.