49,757 Topics

Member Avatar for
Member Avatar for McCo

[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 …

Member Avatar for Ancient Dragon
0
182
Member Avatar for matharoo

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; …

Member Avatar for Ancient Dragon
0
136
Member Avatar for nizbit

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 …

Member Avatar for tetron
0
259
Member Avatar for ehsun7b

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 …

Member Avatar for Ancient Dragon
0
153
Member Avatar for CreativeCoding

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^ …

Member Avatar for tetron
0
146
Member Avatar for sblass92

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 …

Member Avatar for sblass92
0
105
Member Avatar for abhimanipal

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; }; …

Member Avatar for mattjbond
0
158
Member Avatar for Learning78

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. …

Member Avatar for Learning78
0
2K
Member Avatar for EddieC

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 …

Member Avatar for Marcio Silveira
0
373
Member Avatar for PDB1982

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 …

Member Avatar for tetron
0
528
Member Avatar for kiLLeR-eyEd_14

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 …

Member Avatar for rahul8590
-6
774
Member Avatar for Adrian99420

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 …

Member Avatar for dittukumar
0
155
Member Avatar for avataralien

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; …

Member Avatar for thomas_naveen
0
64
Member Avatar for 28daniela28

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 …

Member Avatar for tetron
0
192
Member Avatar for endframe

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 …

Member Avatar for BrianWren
0
225
Member Avatar for johndoe444

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 …

Member Avatar for rdxblast
0
129
Member Avatar for nola_Coder

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 …

0
64
Member Avatar for !nsane

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; …

Member Avatar for !nsane
-1
126
Member Avatar for samurai1200

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 …

Member Avatar for samurai1200
0
1K
Member Avatar for Duncans Ghola

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 …

Member Avatar for Duncans Ghola
0
158
Member Avatar for deeprocks31

i want to learn how to insert graphics in C++ pl. help me and suggest some books

Member Avatar for sblass92
0
62
Member Avatar for mrnobody

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.

Member Avatar for Ancient Dragon
0
54
Member Avatar for mrnobody

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 …

Member Avatar for Ancient Dragon
0
106
Member Avatar for rahulrulez

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 …

Member Avatar for rahulrulez
0
179
Member Avatar for tr6699

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 …

0
90
Member Avatar for digonio

Hi, I am a complete newbie and these are the first lines of code that I write, so please be patient :( I need to create a C# exe file that calls a c++ function What I wrote always throws an error at runtime: [code]Unhandled Exception: System.AccessViolationException: Attempted to read …

Member Avatar for kvprajapati
0
217
Member Avatar for Stefano Mtangoo

I'm reading casting functions(I wonder if this is proper name). I get difficult grasping dynamic_cast, static_cast, constant_cast and reinterpret_cast. Can anyone help me in "layman" terms differences and where we may use them? [URL="http://www.cppreference.com/wiki/start"]reference[/URL] and [URL="http://google.com"]google[/URL]

Member Avatar for Stefano Mtangoo
0
65
Member Avatar for spetsnaz26

I'm programming using Visual Studio 2005 with Intel's Cilk SDK installed and learned there were some bad writing/reading happening at some specific memory locations, such as 0x00254c0( I can't remember the exact location, this is only an example). I have no idea what is going on at those locations and …

Member Avatar for spetsnaz26
0
118
Member Avatar for Gnawk

#include <iostream> using namespace std; bool isPrime (int num) { int counter=0; { for(int i=1; i<=num ; i++) if (num%i==0) counter++; if (counter==2) return true; } return false; } //prints primes void printPrimes (int num) { for(int i=2;i<=num;i++) if (isPrime(i)) cout<<i<<","; } // if there is no prime number between …

Member Avatar for Gnawk
0
124
Member Avatar for strmstn

Hello there. I don't know if this should actually be posted in any of the C/C++ forums, but it is mainly an Assembly question so I take my chances here. In C/C++ it is possible to declare local variables as: [CODE=C]if(statement){ int var; // Use of the variables }else{ // …

Member Avatar for strmstn
0
201

The End.