49,761 Topics
| |
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 … | |
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 … | |
Hi everyone. So here's the case, I am a newcomer in C++ and I have been working on a small begginers program ; it adds 2 numbers after adding 1 to each of those 2 numbers . Let's say if we put 4,5 then it will add 1 to both … | |
The following code fragment from Programming Pearls: [CODE]for i = [0, n) if comlen(a[i], a[i+1]) > maxlen maxlen = comlen(a[i], a[i+1]) maxi = i[/CODE] I am not sure why he called the comlen function twice? Instead he could save the computed value in a temporary and use it to assign … | |
I am wondering how I can make my program not keep looping the input of a key or mouse click. For example, I'm writing a game that uses WASD keys for movement of character, and say spacebar to jump. How can I have it work so that regardless if I … | |
Hi! I'm just started learning C++ and i tried to do a calculator for fun. I did not succeed :$ There is an error here that i cannot find... Please, if you find it let me know :icon_smile: [CODE]#include <iostream> #include <cmath> using namespace std; int main() { double num1; … | |
In C++ using gc++ compiler (netbeans, ubuntu), I am trying to pass a struct into a function (working fine), operate on an array in the struct (fine). But when I leave the function (which is void return value), the struct values snap back to their initialized values. the struct in … | |
I have been assigned to implement a string class and I am having a hard time with the >> operator overload. Header File: [CODE]std::istream& operator >>(std::istream& ins, obstring& target);[/CODE] Implementation: [CODE] std::istream& operator >>(std::istream& ins, obstring& target) // Postcondition: A string has been read from the istream ins, and the … | |
i want to learn how to insert graphics in C++ pl. help me and suggest some books | |
Hi, I'm doing a dialog box in VC++ 6.0. Can somebody please advice me how do I put an icon/bmp file on the title bar..? (Refer to the picture attached) I've tried searching it in books and google but i couldn't find anything. Thanks. | |
Hi, I've got a dialog box and I use picturebox to put bmp background picture to fill the whole dialog box. After that, I draw some textbox and button in the dialog box. My intention is to have the buttons and textbox infront of the picturebox. But what happen instead … | |
Hello, I'm working on my project "The Vending Machine Software" Here I need to use Graphics and mouse handling.. I'm totally new into Mouse programming in C++, still doing the coding with help of some online tutorials.. What I've to do is, Show a welcome page first when I run … | |
This program reads an the following input from a file 1 2 3 2 4 5 3 5 4 6 5 6 6 0 Then inserts the values into a two dimensional array. For example the first line 1 2 3 would insert a value of 1 into map[1][2] and … |
The End.