49,762 Topics

Member Avatar for
Member Avatar for enderes05

i need to write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity and the number of people to attend the meeting. if the number of people is less than or equal to the maximum capacity, the program announces …

Member Avatar for enderes05
0
102
Member Avatar for coachkrzyzewski

I'm working in implementing a hash table, and I'm running into a Seg Fault whenever I try to access my buckets :( Here's the code: simple test class [code] //TEST HASH!! #include "hashTable.h" #include <iostream> #include <string> using namespace std; int main() { hashTable htab(101); htab.insert("blah"); cout << htab.contains("blah") << …

Member Avatar for mitrmkar
0
3K
Member Avatar for endframe

Hi everybody, I wanna learn how can I solve this problem of undefined symbols while trying to load them from another function. Here's the code to explain: [CODE]void maxmin(struct ma mx) { int max=mx.ev[0]; int min=mx.od[0]; for (int i=0;i<10;i++) if (mx.ev[i]>max) max=mx.ev[i]; for (int j=0;j<10;j++) if (mx.od[j]<min) min=mx.od[j]; cout<<"The biggest …

Member Avatar for endframe
0
339
Member Avatar for TSaunders84

ok in the first function i am suppose to read in the data from the file for the next node, allcatees the node, assigns the members, and return a pointer to the new node through the function return type i have no idea how to do that can you look …

0
62
Member Avatar for Kosithc

Hello, I am a totally newbie and I would be pleased, if you could help me. Here is the problem: I have created VS 2008 project and configured it for using the ITK (toolkit for medical image analysis - in my case for reading Dicom images). Everything worked OK until …

Member Avatar for Kosithc
0
627
Member Avatar for yogi2345

in my computer tarbo c is not raninig. it show the message"16 bit sub system". what can i do.plz replay in[I] <<snip>>[/I]

Member Avatar for Ancient Dragon
-1
63
Member Avatar for avataralien

May I know what are bits fields & the 5 bits of hole for? [CODE] struct Record { unsigned int n1 : 3; // 3 bits, can store 0 - 7 int : 5; // 5 bits of hole unsigned int n2 : 4; // 4 bits, can store 0 …

Member Avatar for Fbody
0
73
Member Avatar for sho12345

Hi everyone, I am having problems with my c++ code for about 2 - 3 hours now and decided I need help. I am a student at a college and I am trying to code this for my assignment. cpp file:[CODE] #include "bridgehand.h" BridgeHand::BridgeHand() { for (int x = 0; …

Member Avatar for Galf
0
169
Member Avatar for CreativeCoding

So I have looked and looked and wasn't able to find how to retrieve text from a selected option in a combobox. I have just started visual c++ so I don't really understand a lot. But I used to work with Visual C# before. So, is there any way? [CODE]if(comboboxslectedvaluethingy …

Member Avatar for CreativeCoding
0
162
Member Avatar for yapkm01

i'm newby to C++. Small code as follows: [code] int main(int argc, char* argv[]) { cout << "function main() .." << '\n'; char ch1; int int1; cin >> ch1; cin >> int1; cout << ch1 << '\n'; cout << int1 << '\n'; return 0; } [/code] when i run the …

Member Avatar for vmanes
0
110
Member Avatar for dreamstone

Hi All, I am currently learning C++ and I have been asked to make a program which will calculate the interest that would be paid on a deposit of a given size. One of the requirements is that we display an error message when non-integer data is entered.

Member Avatar for vmanes
0
94
Member Avatar for lgonzo

been doing reiew questions to prepare for a c++ test, and was hoping someone could help me out by looking over the ansewers i have so far. what i have is in red. thank you very much :) -- Which of the following operations has the highest precedence? a. Postincrement. …

Member Avatar for WaltP
0
2K
Member Avatar for James.Butcher

Hello, I'm new to programming forums so go easy on me :) I'm working on an assignment for school. I have to read a quiz.dat file which cotains info in the format of: TTTTTFFFFFTTTTT TTTTTFFFFF TTTTJoe Jones TTTTTFFFFFT TTFMary Jane ... ... etc. The first line being the answer key …

Member Avatar for Ancient Dragon
0
322
Member Avatar for sid78669

Can someone please tell me why I might be getting a access violation when doing the following for a double linked list: [CODE=C++] ~DLList() { while(!isEmpty()) //isEmpty is working.. removeHead(); } bool isEmpty() { if(head == NULL && tail == NULL) return true; else return false; } char * removeHead() …

Member Avatar for sid78669
0
949
Member Avatar for lgonzo

got some noob c++ questions that hope someone can help me with ---The statement while ( --counter >= 1 ) counter % 2 ? cout << "A" : cout << "B"; cannot be rewritten as: a. while ( --counter >= 1 ) if ( counter % 2 ) cout << …

Member Avatar for vmanes
0
303
Member Avatar for mbrinkley

I have been working on this program for about two weeks. I missed the day that the professor covered the material necessary to code this program due to surgery. I am now behind about 5 programs that are due at the end of the week and I'm trying to teach …

Member Avatar for mbrinkley
1
174
Member Avatar for GSPprog

Hi I am trying to get this program to work to insert a node into the list and move the list down so the node will fit. I get the node to be inserted into the right place but the list is copied as such. if 1. joe 2. linda …

Member Avatar for Ancient Dragon
0
99
Member Avatar for Spiderpig085

Hi guys, uve been workin on a restaurant program and im tryin to write the time to the end of the receipt. so im writing information to a file. only problem is i cannot make my time function return the current time. I've tried everything. can you guys help?? im …

Member Avatar for abhimanipal
0
170
Member Avatar for lgonzo

was hoping someone with more experience could look over and tell me if these answers look alright. in red is what i got -- srand: a. Should be called before each call to rand. [COLOR="Red"]b. Should be used instead of rand to generate truly random numbers.[/COLOR] c. Is unnecessary in …

Member Avatar for Galf
0
358
Member Avatar for Velovix

To start off, I am absolutely sure this question has been answered before, but I've searched for it all over the internet to no avail, probably because I don't know the term. I've been working with Eclipse C++ IDE on my Ubuntu machine for awhile, and all of my programs …

Member Avatar for Velovix
0
210
Member Avatar for ignorantpenguin

I have an int that I need to store as two chars. So is there some way to get the first 8 bits and the second 8 bits and store them as chars. And if so, how would I recombine them later to get a meaningful int value?

Member Avatar for Ancient Dragon
0
130
Member Avatar for jimJohnson

I have a question for entering an atm number in a simulated atm. What happens is when i enter 1 to enter a pin number it fails on me three times. If I hit a 2 it does what it is supposed to. When I enter something other than a …

Member Avatar for jimJohnson
0
239
Member Avatar for epicasian

When I try to compile this: [code=C++] //Player Class Definitions #include <iostream> #include "player.h" using namespace std; player::player() { health = 100; level = 1; potions = 10; enemiesDefeated = 0; } int player::attack(int *enemyHealth) { srand(time(NULL)); int randomNumber = rand() % 100; *enemyHealth = *enemyHealth - randomNumber; } int …

Member Avatar for epicasian
0
324
Member Avatar for epicasian

Hello, What I am trying to do is edit the variable of a class through a separate class function. I have tried to do things like [code=C++] int player::attack(int *enemy) { srand(time(NULL)); int randomNumber = rand() % 100; *consolePlayer.health = *consolePlayer.health - randomNumber; } [/code] and I get the error …

Member Avatar for epicasian
0
101
Member Avatar for rajdey1

hi below is code it is only a part of my program simplified for understanding the main problem i am facing .................... actually the code runs well but while exiting from main [B]displays Null pointer assignment[/B] . May i please request the forum member to debug the program..... the code …

Member Avatar for lafigueroa
0
151
Member Avatar for strmstn

I have three files: main.cpp [CODE]#include "CMain.h" int WINAPI WinMain(HINSTANCE hIn...) { return 0; }[/CODE] CMain.cpp [CODE]#include "CMain.h" using namespace Program; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } CMain::CMain(void) { …

Member Avatar for strmstn
0
93
Member Avatar for wwsoft

Hello I'm creating a game engine. In order to draw everything correctly I need to sort a vector (vector<game_object*>) by each contents z value I miserably failed to do it with std's sort() so Id like to know what's the most efficient way I could sort this vector [If its …

Member Avatar for wwsoft
0
106
Member Avatar for Pynolathgeen

[URL="http://i41.tinypic.com/n2ef5k.jpg"]Screenshot.[/URL] Hello, I have a problem already for like a week and I seriously can't get out of it. Take a look at the screen shot. The server sends a packet to the client to spawn an NPC. If you look to the top commandline-window, the client does recv the …

Member Avatar for Pynolathgeen
0
240
Member Avatar for mikabark

I want to know what is "Vector for the buckets in hash table". I gathered data and stored into hash table. And I want to know how to convert hash table buckets into Vector. If you guys have source, It would be helpful or theory, also welcomed. Thanks you in …

Member Avatar for MyrtleTurtle
0
132
Member Avatar for LeoC++

#include <iostream> using namespace std; int main() { int list[12] = {8,1,11,4,2,9,10,5,3,12,6,7}; cout<<list; return 0; } I run the above code and get this: 0x22fef0Press any key to continue . . . Please help!!! New with C and new with Dev-C++ which my University wants us to use... Running from …

Member Avatar for rahul8590
0
129

The End.