49,761 Topics

Member Avatar for
Member Avatar for maikens

Hi all, I have written a balanced binary search tree as part of an assignment (make a simple Spell Checker). Each node has, among other values, two height ints, leftHeight and rightHeight, to keep track of the heights of any subtrees. My problem is that after a rotation, the heights …

Member Avatar for maikens
0
1K
Member Avatar for Transcendent

I'm supposed to write this c++ that take in 01 and on. for example: 01010101 but not 0,1,10,011,110. Can someone help me figure out what I need to do to fix the problem. [CODE]#include <iostream> #include<stdlib.h> // for the exit(1) function using namespace std; char text[300]; char ToBeChecked; char lexical(); …

Member Avatar for caut_baia
0
148
Member Avatar for Vanquish39

[CODE] #include<iostream> #include<vector> #include<string> using namespace std; struct Item{ string itemName; double cost; }; class User{ public: User() : itemList(0) {}; User(string a, string b) : fN(a), lN(b) {}; void addItem(Item a) {itemList.push_back(a);} vector<Item> getItems() const {return itemList;} void printUserInfo(); private: string fN; string lN; vector<Item> itemList; }; class Convention{ …

Member Avatar for Fbody
0
147
Member Avatar for maikens

Hi all, I wrote this recursive function to set the heights of each node in a search tree. It is not performing as expected; I suspect I screwed up the recursion somehow. Anyone know what the matter is? [CODE]void AVLTree::SetHeight(NodePtr &node) // root is passed in { if(node == NULL) …

Member Avatar for mrnutty
0
141
Member Avatar for Stefano Mtangoo

If I'm not mistaken using library that is GPLed will force your app to go GPL. Is there a way to get away with MySQL GPL licence and use it in closed source (Not necessarily commercial)? Two scenarios here: 1. libmysqlclient is linked dynamically 1. libmysqlclient is linked statically Thanks!

Member Avatar for Stefano Mtangoo
0
449
Member Avatar for shantanusinghal

[CODE=c] int main(int argc, char *argv[]) { ifstream inHandle; Assembler obj; if(argc!=2) { cout<<"InvalidInput ERROR"; } else { inHandle.open("test.asm"); if(inHandle==0) cout<<"FileNotFound ERROR"; else obj.pass1(inHandle); } inHandle.close(); return 0; } [/CODE] this is my code for the main() function, i have tried entering the filename in every possible format but the …

Member Avatar for Narue
0
634
Member Avatar for Smithy566

I'm trying to compare two DateTime objects, but I am receiving the following error. error C2664: 'System:: DateTime::Compare' : cannot convert parameter 1 from 'System:: DateTime ^' to 'System:: DateTime' I'm just trying to use the DateTime 'Compare' method to perform the check. Below is an example to illustrate what …

Member Avatar for jonsca
0
2K
Member Avatar for Lemonader

Hi. It's actually not a C++ code, it's a matlab code. But I hope there's somebody here who can help me. There's not really an appropriate forum here for a matlab code. It's about Gaussian Elimination [url]http://img189.imageshack.us/i/50468910.png/[/url] I already have a code that only needs to be modified. [code] clear …

Member Avatar for peter_budo
0
131
Member Avatar for halleluijah

Hi everyone, I have wirte a programme to display the Palindromic prime, i.e 2,3,5,7,11,101,131,151.......... but I don't know what's wrong with my code, it can only display the number up to 11 and then no response. Could yuou help me to check out what's wrong? thank you so much. Here …

Member Avatar for pyromania
0
248
Member Avatar for Dundir

Hello, I'm working on a Pyramid Problem. I got it working, but it took a huge amount of time. How should I tackle a problem like this in the future. I don't think it should have taken me 4 hours but I had the most horrible time getting the formatting …

Member Avatar for WaltP
0
77
Member Avatar for spoonlicker

I have no idea at all, nothing, on how to make a full, running and working snake game. I tried starting off using character symbols in ASCII to draw its head and body, but from there on I have no clue on how to make it move with out having …

Member Avatar for kayhantolga
0
342
Member Avatar for jasoncastro

Hi again! is there any way a program can read a .txt file without typing the .txt extension name? I need this for my ATM program for accessing an account number, it wouldn't look right if i have type 1234667.txt. I'm using Borland C++. Hope you can help me! Thanks! …

Member Avatar for jasoncastro
0
341
Member Avatar for txwooley

I am completely new to C++. I have a function that deals cards for a blackjack game. To do this, I need to call this function 10 times (two cards each for 4 players and a dealer). But it just deals the same card to everyone. I think it might …

Member Avatar for WaltP
0
152
Member Avatar for lochnessmonster

if i want to inline a member function do i need to have it in both places below(decleration and implementation section)? or can i just place it in implementation section only or decleration section only and get the same result? class Ray { public: inline allocate( const int Lize ); …

Member Avatar for mike_2000_17
0
129
Member Avatar for LexLieberthal

My friend needs a program that will: 1. Ask the user for the size of the matrix. The choices are 2x2 or 3x3. 2. Ask the user for the operation to perform. The choices are addition or subtraction. 3. Let the user input the numbers for the first matrix. 4. …

Member Avatar for LexLieberthal
-1
145
Member Avatar for Alice1990

This is a file named InBoundData.txt [TEX] 1 B777 850 Paris KL 9395 11.40 am 6 2100 2 B747 900 Lon KL 10000 12.30 pm 7 2100 3 A380 900 LA KL 16800 10.30 am 15 2750 4 A340 850 CapeTOWN kL 9580 12.10 pm 6 3000 5 A330 800 …

Member Avatar for Alice1990
0
330
Member Avatar for LuciaPwNs

So here is cliff notes of my assignment: -Use Inheritence -Person(lname, fname, address) inherited by employee(rate, hours) What I would like to do: -Find how long my arrays have to be(depends on file length) -open file -go to function retrieve lastname from file -go to another function retrieve firstname ...etc …

Member Avatar for prvnkmr194
0
191
Member Avatar for SacredFootball

[CODE] #define cinGetValue(value,status) \ { \ string inputLine; /* raw user input text*/ \ istringstream convert; /* string converstion variable.*/ \ \ getline(cin,inputLine); /* get a string of data from user input (could be empty) */ \ convert.str(inputLine); /* load 'convert' with user input */ \ convert >> value; /* …

0
74
Member Avatar for failbot

So, I'm writing an implementation of List in C++ as a programming exercise, so far I have this: [CODE]#include <iostream> #include <algorithm> using namespace std; template <class T> class Link; template <class T> class List_iterator; template <class T> class List { public: typedef List_iterator<T> iterator; List(); List(const List<T> & l); …

Member Avatar for failbot
0
345
Member Avatar for tdba.316

After a few months of learning and practicing C++ with the book C++ Primer Plus through Chapter 7, I decided to do myself a little simple program. I started with the decision to try splitting my program into multiple files, and I decided to collect all shared declarations/definitions (*) into …

Member Avatar for tdba.316
0
2K
Member Avatar for jasoncastro

Hello I'm new at using c++ and new at this forum as well, I'm wondering if you could help me with my atm project. Could you please show how to make my program accept pin number but display ***** or any other character,[ICODE][/ICODE] instead of showing numbers when inputting them? …

Member Avatar for jasoncastro
0
2K
Member Avatar for rbduck09

Can someone please explain it saying that warning C4700: uninitialized local variable 'd' used? Enhance the Quadratic program in the following manner. If the user enters a valid set of coefficients (the else” case compute the value )of the discriminant d, defined as: d = b^2 - 4ac If the …

Member Avatar for rbduck09
0
220
Member Avatar for akase2010
Member Avatar for Muhammad Sumair

How can i get graphics.h header file and put it in my Visual C++ 6.0 directory ??

Member Avatar for Muhammad Sumair
0
180
Member Avatar for sharksaw40

Hi I have recently learned c++, I'm 14 and want to get started on developing software. The problem is I'm too young to get a career in programming but I would like to start now partly to make it easier in later life and partly because I enjoy programming. The …

Member Avatar for sharksaw40
0
256
Member Avatar for yeahyeah85

Hi, i am trying to write a program for my homework. Write a function, lookupPrice that uses the product code to look up for the price. If the product code is on special promotion, a 10% discount is given. If the product code is found, the function returns the price, …

Member Avatar for yeahyeah85
0
94
Member Avatar for lochnessmonster

after examineing this code, it seems like it actually allocates space for the pointer....but how? is this a bug? how can u allocate space for an array of 0 elements [CODE]int main() { int *ptr = new int[0]; return 0; }[/CODE]

Member Avatar for template<>
0
88
Member Avatar for cppgangster

Hi I am trying to put up simple app, and i get an error, could you tell me what I am doing wrong please. Here is my code: [CODE] #include <afxwin.h> class myapi: public CWinApp { public: virtual BOOL InitInstance(); }; class myframe: public CFrameWnd { public: myframe(); protected: afx_msg …

Member Avatar for cppgangster
0
550
Member Avatar for InLondon76

Was asked this question for an interview and really wasn't sure how to answer it. Can anyone suggest examples of where a bug will only present itself when using multiple CPU/core and NEVER happen on a single CPU? The question didn't mention "threading", i.e. nothing specific about threads running within …

Member Avatar for template<>
0
307
Member Avatar for valkyrie

I wanted to know,,,clock(); functioning in C++,,,actually I am making a program based on IQ analysis and It has certain time limit in each question for answering,,,but as I don't know how to use clock(),,,,,that's why it's creating a problem for me.....plzzz help me out.....I would be very thankful...

Member Avatar for template<>
0
199

The End.