51,593 Topics
![]() | |
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 … | |
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 … | |
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] | |
I am trying to make a program so that you can enter your name, but I want to limit the amount of characters used to 10. This is what i have so far, and when i press backspace on my program, it doesn't delete the previous character but moves the … | |
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 … | |
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; … | |
Hi, Thanks to the help on my other posts I am starting to be able to manipulate Excel through C# quite successfully. My new question is: I am just about to register a domain for the purposes of personalised email. I don't have any particular need (at the moment) for … | |
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 … | |
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 … | |
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. | |
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. … | |
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 … | |
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() … | |
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 << … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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) { … | |
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 … | |
[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 … | |
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 … | |
#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 … | |
ok so im doing a project for a class, no body but me is doing c++ for it, im the only one in my school that knows some of it, and heres what i have so far, havnt gotten into too much detail for it because i need to know … | |
Hey all! I'm new to C++ and am having trouble with the Do...While loop terminating. My problem is I want the loop to end when the user enters 'X' when asked for an operation. When 'X' is entered it still asks for a number and then displays the current total … | |
I am planning to save files using xml writing as an alternative to MFC serialization. I want my application to use xml file writing and reading. I am using ofstream and ifstream for this. [B]Lets say my application files are have a format .xyz[/B] So,the main problems I am facing … | |
Hello. I am creating a template class derived from another template class to basically mimic the behavior of the STL stack for a school project. I am getting a compile time error when try to use a variable named "copy" when testing the overloaded '=' (defined in the base class) … | |
I'll do my best to be as clear as possible about what I'm trying to do. In short, I'd like to know if a switch statement can check multiple variables simultaneously (I have a feeling it can't, but I'd like to confirm). If it can't, can someone recommend a way … | |
Hi and this function I wrote as part of a larger project and acts exactly like the php explode function. Although there a few slight differences between this function and the php explode function it can easily be tweaked to act identical. Also with this function it does not use … | |
[QUOTE=vegaseat;74347]There is another way to make a sound, quite simple, you load a wave file and play it: [php]// play a wave file sound using the winmm library // For DevCpp add the library libwinmm.a to linker via // Project/Project Options/Parameters/Add Library // remember this is a console program! #include … | |
I am making Railway reservation sys. i want to pass these set of statements into a function how can i do that???? I have used structures in the program... [CODE]cout<<"--TICKET SUMMARY--"<<endl; cout<<"Passenger Name :"<<o2.pass_name<<endl; cout<<"Age :"<<o2.age<<endl; cout<<"Sex :"<<o2.sex<<endl; cout<<"Train Name: "<<o1[x].train_name<<endl; cout<<"Arrival Time: "<<o1[x].t_arr.hrs<<":"<<o1[x].t_arr.min<<endl; cout<<"Departure Time: "<<o1[x].t_dep.hrs<<":"<<o1[x].t_dep.min<<endl; cout<<"Seat Class: 2A"<<endl; … | |
I need some dire help. Whenever I execute my program I get this message "./main: free(): invalid next size (fast)". Which leads me to believe something with my dynamic allocation of an array. I've used a debugger and pinpointed the error to the method where I'm trying to increase the … | |
I'm using NetBeans 6.8 + MinGW + MSYS I try to develop a simple Winodws application e.g: [CODE] #include <windows.h> int WinMain(HINSTANCE,HINSTANCE,LPSTR,int) { MessageBox(0,"Hello, Windows","MinGW Test Program",MB_OK); return 0; }[/CODE] Or something like this: [CODE] #include <windows.h> char *AppTitle="Win1"; LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); int … | |
So I'm making this program, and this is what I have so far [CODE]private: System::Void load_Click(System::Object^ sender, System::EventArgs^ e) { outs("ComputerName", SystemInformation::ComputerName); outb("Network", SystemInformation::Network); outs("UserDomainName", SystemInformation::UserDomainName); outs("UserName", SystemInformation::UserName); outbm("BootMode", SystemInformation::BootMode); outi("MonitorCount", SystemInformation::MonitorCount); outb("MonitorsSameDisplayFormat", SystemInformation::MonitorsSameDisplayFormat); outad("ArrangeDirection", SystemInformation::ArrangeDirection); outb("MousePresent", SystemInformation::MousePresent); outb("MouseButtonsSwapped", SystemInformation::MouseButtonsSwapped); outb("UserInteractive", SystemInformation::UserInteractive); outr("VirtualScreen", SystemInformation::VirtualScreen); } public: System::Void outs(String^ x, String^ … | |
I'm trying to declare a vector as a global variable, and am getting a linker error. I read up on linker problems with multi-file projects, pretty sure I've included the proper headers, used extern, and #ifdef properly, but I can't get it yet. Here is what we have: [CODE] //in … | |
Hello Everybody, Most of my coding experience is in C. Although I have a background in C++, I know very little of STL and the advanced topics in C++. I came across this code [code=c++] struct g { g():n(0) { } int operator()() { return n++; } int n; }; … | |
Hi; I have an edit control that takes string input from user and a CButton 'Record' to record that input. I want to catch the control and disable it when the user input is empty. I want to make sure that this enable/diable happens with the click of Record CButton. … | |
Are you a certified function point specialist or play one on TV? Then the Counting Practices Manual version 4.3 might be for you. Unveiled today by the [url=http://www.ifpug.org/]International Function Point Users Group[/url] (better known as IFPUG), the $100 CD contains the latest "body of knowledge used by function point analysts … | |
I am trying to create a rational numbers program from scratch (I'm a brand new student basically), and I have all my inputs working right now. My problem lies within my showFraction() function, but I can't figure out how to fix it. It should output the inputs from the user … | |
Hello peepz..Please try to look at my codes and read every comments i put there..I hope someone could help me with it..Especially those it graduates and higher level to me..I'm only first year college student..We're on visual c++..This is the link to my codes, please [url=http://ke14.emenace.com/Files.zip]download[/url] and post the solved … | |
Hi, I created a combobox and binded it with MS access table using following code: [code] this->oleDbDataAdapter1->SelectCommand->CommandText="SELECT DISTINCT Profile_Name FROM Profiles"; this->oleDbDataAdapter1->Fill(dataSet1,"Profiles"); DataTable^dt= dataSet1->Tables["Profiles"]; comboBox1->DataSource= dt; comboBox1->DisplayMember = "Profile_Name"; [/code] I got the correct profile name I needed in the combobox. I tried it using textbox, textBox1=comboBox1->SelectedItem->ToString(); However,it always return … | |
I found this code somewhere on the net... But i dunno how to stop this...Its keeps animating and i dont know when will this stop... [CODE]#include <stdio.h> #include <time.h> void sleep ( long milli ) { clock_t end, current = clock(); for( end = current + milli; current < end; … | |
What does prev, curr & temp stand for? [CODE]struct Node; typedef Node* NodePtr; struct Node { void* data; NodePtr prev, curr; }; void bigTraversal(const NodePtr& head, const NodePtr& tail) { // need to by pass by temp NodePtr temp = head; while(temp != NULL) { temp = temp -> next; … | |
Hi, I'm trying to end a project that should do next points: -generating a random vector ( for that I have the function generareVector); -reading the vector from the file where it was generated ( citireVector); -sorting the vector using different methods of sort; -checking if the resulted vector was … |
The End.