Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~6K People Reached
Favorite Forums
Favorite Tags
c++ x 83
Member Avatar for JackDurden

I have this error when debugging called Debug Assertion Failed , does anyone know what that means? Im using Visual C++ 2008. [CODE]void merge (string alpha, string beta) { string temp; string temp2; stringstream insert(alpha); stringstream insert2(beta); // Insert the string into a stream ostream_iterator<string> output(cout, " "); vector<string> words; …

Member Avatar for shijobaby
0
788
Member Avatar for JackDurden

How do you erase an element thats inside a map. Not the key but the element the key is pointing to? This doesnt seem to be doing what i want it to. [CODE]map<int, vector<int> > my_map; map<int, vector<int> >::iterator it; void erase(int num) { for(map::iterator item=my_map.begin();item != my_map.end()) { if(it …

Member Avatar for jesseb07
0
144
Member Avatar for JackDurden

I was wondering if you guys might help me figure out how to make a vector of vectors like so, The user will name the set say 'A'. And then using 'A' as a key you can then find the set name and add say 'a', 'b' to it. How …

Member Avatar for Ancient Dragon
0
179
Member Avatar for JackDurden

I have a vector which i wish to fill with char's, so that each char is then a pointer to a vector. vector<char> list; list[0] = 'A'; list[1] = 'B'; How do I make 'A' and 'B' pointers to other vectors? [CODE] void Create_Pointers(char pointer_name) { pointer_name = new vector<char …

Member Avatar for daviddoria
0
114
Member Avatar for JackDurden

How would I find a row with a column value? Say Im looking for people with the name "Lance" then once ive found Lance display the row of info for lance. Ive tried using select but cant seem to get it to work. Here is my code. [CODE] using System; …

Member Avatar for flavioweb1
0
254
Member Avatar for JackDurden

I want to find the first null child in a tree and return that node of the tree. Im thinking something like this but it doesnt seem to work the way I want. [code=cplusplus] node *Find_Empty_Node(node* root) { int index = 0; if(root) { if(root->data == 0)//<--I want this child …

Member Avatar for rcollins
0
105
Member Avatar for JackDurden

IF i have this function... [CODE] node* get_lowest(node* root) { node* min = root->child[0]; for(int i = 0; i<root->child.size();i++) { if(min > root->child[i]) min = root->child[i]; } cout<<"Here it is:"<<min->data<<endl; return min; } [/CODE] how do I get it to return the smallest indexed pointer? for example if root->child[0] and …

Member Avatar for VernonDozier
0
248
Member Avatar for JackDurden

Would someone be so kind as to help me with this insert. The function insert takes two numbers, num and num2. num is the number to insert in the tree and num2 is the number of children to the parent node where num is inserted. I am getting errors for …

Member Avatar for VernonDozier
0
102
Member Avatar for JackDurden

So in a binary tree the insertion looks something like this: [CODE] void btree::insert(int num) { if(root!=NULL) { insert(num, root); } else { root=new Node; root->data=num; root->left=NULL; root->right=NULL; } } void btree::insert(int num, Node *leaf) { if(num< leaf->data) { if(leaf->left!=NULL) { insert(num, leaf->left); } else { leaf->left=new Node; leaf->left->data=num; leaf->left->left=NULL; …

Member Avatar for csurfer
0
117
Member Avatar for JackDurden

is there a way to pass in numbers(int) like this? somename([0,0],[2,4],3); thanks for any help

Member Avatar for JerryShaw
0
98
Member Avatar for JackDurden

Is it possible to input numbers into two different arrays like so, 1 2 3 4 5 6 7 8 9 where the first array would hold {1, 3, 5, 7, 9} and the second array would hold {2, 4, 6, 8}?

Member Avatar for Rashakil Fol
0
81
Member Avatar for JackDurden

I want to enter in a bunch of integers like so: 1 11 2 12 3 13 4 14 5 56 6 80... How would I get them into an array of int? [CODE]Console.WriteLine("Enter in numbers"); string answer = Console.ReadLine(); int[] myArray = new int[answer.Length]; for (int i = 0; …

Member Avatar for JerryShaw
0
103
Member Avatar for JackDurden

Trying to make a circular queue, but its not working right. Enqueue is just adding things to the end, every time. my output is: Numbers in Queue: 1 2 3 Numbers in Queue: 2 3 Numbers in Queue: 2 3 6 it should be: Numbers in Queue: 1 2 3 …

Member Avatar for Rashakil Fol
0
91
Member Avatar for JackDurden

Im trying to make a circular queue. Why does empty keep saying my q is empty? [CODE]using System; namespace CQueue { class Program { static void Main(string[] args) { List queue = new List(); Double number = 9.13; queue.Enqueue(number); queue.Enqueue(number); queue.PrintQueue(); } } } class List { object[] thisIsQ = …

Member Avatar for Ramy Mahrous
0
107
Member Avatar for JackDurden

How would I delete one char from a string? [CODE]string aWord = "question?"; while(aWord[i]) { if(isalpha(aWord[i]))printf ("character %c is alphabetic\n",aWord[i]); else delete[i]aWord; i++; }[/CODE]

Member Avatar for cikara21
0
220
Member Avatar for JackDurden

Does anyone know how to search a text file for just alphanumeric words using regex? And could you show me?

Member Avatar for StuXYZ
0
98
Member Avatar for JackDurden

Im trying to count the frequency of words from a file and cant seem to get it to work. My frequency function recognizes the word is there but doesnt return a count for each word yet. The text file would just hold a bunch of random words...please help. [CODE]#include <string> …

Member Avatar for cikara21
0
196
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
99
Member Avatar for JackDurden

Im having trouble seeing this recursion function through. Say I have an 8 by 8 array how would I get the search function to "see" into the middle of the 8 by 8 array. Positions (4,4), (4,5),(5,4),(5,5). [CODE] #include <iostream> using namespace std; struct matrix { int size; int row; …

Member Avatar for skatamatic
0
65
Member Avatar for JackDurden

Say you have a class called example: [CODE]class example { int one; int two; };[/CODE] and you use this to get numbers from the user: [CODE]example number; cout<<"enter numbers"<<endl; cin>>number.one>>number.two;[/CODE] and then you call one function to manipulate the numbers and another to do some more manipulation. How do you …

Member Avatar for Ancient Dragon
0
99
Member Avatar for JackDurden

How do I insert a character into a number array? Is it possible? a and b are constants. [CODE]for(int i = 0; i <n; i++) { pointer[i] = new int[n]; } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { pointer[i][j]=1;/ pointer[a][b]="*"; //<---- } }[/CODE]

Member Avatar for rhoit
0
96
Member Avatar for JackDurden
Member Avatar for Agni
0
274
Member Avatar for JackDurden

So if I have a header file like this: [CODE]template<typename T> class snake { public: void example(); private: T *start_Ptr; };[/CODE] and then a source file like this: [CODE]#include <iostream> #include <stddef.h> #include "foo.h" using namespace std; template<class T> struct node { T data; node *next; }; template<typename T> void …

Member Avatar for Sci@phy
0
85
Member Avatar for JackDurden

Im having real trouble seeing this, how do I delete something out of a linked list if it is already there? My current delete function just deletes everything out of the list. the text file contains numbers like this: 75 85 95 25 35 75 85 95 25 [CODE]#include <iostream> …

Member Avatar for JackDurden
0
81
Member Avatar for JackDurden

Im just getting garbage in the output. It outputs the correct number of items but its not the right numbers. Im not sure why it is happening. The text file just has numbers like this: 12 34 56 34 67 23 64 23 [CODE]#include <iostream> #include <fstream> using namespace std; …

Member Avatar for JackDurden
0
84
Member Avatar for JackDurden

How do I get the data from file into the Insert function? Or more general how do you get data from a file and put it into a linked list? [CODE]#include <iostream> #include <fstream> using namespace std; class List { public: void Insert(); void Print(); }; struct node { int …

0
81
Member Avatar for JackDurden

Im trying to find out if something is in this linked list function and if it is to return true and if not return false. How do you find out if ThingType thing is in the list? [CODE]bool Thelist::Search(ThingType thing) const { Node* current; current=listPtr; while(current->thing != listPtr->thing) { } …

Member Avatar for Narue
0
72
Member Avatar for JackDurden

Can I use getline to get two lines of string data? for example: [CODE]string line; string myfile; ifstream file; file.open(myfile.c_str()); while(!myfile.eof()) { getline(myfile, line) }[/CODE]

Member Avatar for Ancient Dragon
0
501
Member Avatar for JackDurden

How do I input a string then output a vector from this function? The compiler doesnt seem to like "while(invector>>word)". [CODE]vector<string> example (string invector);//prototype vector<string> example(string invector) { string word; stringstream insert(invector); vector < string > vectemp; while(invector >> word) vectemp.push_back(word); for(int i = 0; i < vectemp.size(); i++) cout …

Member Avatar for Narue
0
118
Member Avatar for JackDurden

How do I use a pointer with a 2-dim array? I am converting string to char array. char x[25][100]; const char* A= x; A= x.c_str();

Member Avatar for Ancient Dragon
0
101