49,761 Topics
| |
Can anyone explain why I can't sort this vector: [code] #include <iostream> #include <vector> #include <algorithm> #include <memory> struct Test { public: Test(const unsigned int input) : a(input){} int a; }; struct SortFunctor { bool operator()(std::shared_ptr<Test>& object1, std::shared_ptr<Test>& object2) { return(object1->a < object2->a); } }; ////////////////////////// int main (int argc, … | |
Hi everybody, Is it possible to write a c++ compiler in c++ ? Its bootstrapping, right ?? In which language are usually written compilers ? Thanks | |
I have a piece of software, that I would like to license and protect but I am having a hard time finding the right license, and how I would go about with it. Is there a license that allows: - Free distribution of the executable and DLL's - Costs money … | |
This is a way to force a given aspect ratio of a window any time the user tries to resize or cascade it. [CODE] double aspectRatio = 640.0 / 480.0; WPARAM sideBeingDragged = 0; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); … | |
I have an idea for a program but I don't know if its possible. I want to write a program that can read commands from a file.. For example, I've seen bots that can parse and read javascript for games and execute whatever is in the .java file.. How can … | |
C++ course has started in my college. I would like to know the best beginner book for C++. My teacher has referred Robert Lafore and The Complete Reference. Since there are a lot of suggestions given in the sticky thread, I am confused. Thanks in advance :) | |
I have a Win32 Application in C++. At runtime, It loads a Matrix stored as TXT file in the working directory with I/O functions. I have problems to distribute my program (EXE and DLL) because people normally forget to move the text files together with the Application. How can I … | |
at first, plec correct me this one... [code] std::string explanation; // this upper coding char explanation; //after entering void to display if(item_code=='A') explanation='BABY WEAR'; else if(item_code=='B') explanation='CHILDREN WEAR; else if(item_code=='A') explanation='LADIES WEAR'; else if(item_code=='A') explanation='MENSWEAR';[/code] BABY WEAR and others was error, what should i put? plz correct my coding above … | |
Hi all new to this forum, just thought i'd post in here because i am having a bit of trouble with an assignment... basically i have this class in a header file called Product.h... [CODE] class Product { private: int _id; unsigned int _price; public: }; [/CODE] I access this … | |
:?: Is there any way, in Turbo C++, by which we can make the mouse disappear when it enters a certain area of the screen ? I have tried this but it doesnt seem to work completely.... ------------------------------------------------------------------------------------[code=c] void initmouse() { union REGS in,out; in.x.ax=0; int86(0x33,&in,&out); } void showmouse() { … | |
Hi all I have a program, which I can do and in that program the user can enter information if he had missed to enter it in the required field and he must to be informed about this option. [CODE]//verification of the PIN Edit6->Text = ""; int digits[10]; AnsiString egn … | |
how to write this in c++??? while (Q not empty) { u = deleteMin (Q) for each v adjacent to u if (v is in Q and w(u; v) < key[v]) { key[v] = w(u; v); //decrease key T[v] = u; }} | |
I have a problem, whenever I attempt to use the following expression it returns -3. Can you please explain why this is? [CODE] int level = ((RoD * 10) - 50) / 15; std::cout << "Level = " << level << std::endl; [/CODE] | |
Hi, I have a basic understanding of C++ and was creating something myself with a class of 6 integers and a string what I want to do is to be able to find the mode values for each of the six integers and strings I have instantiated a set of … | |
hey im using vc++ clr to build my application...im using the datagridview, but im having some problems with it because its quite poorly documented in C++..i want to know a couple of things. 1... how to change the color and text of a single row header cell as well as … | |
I'm looking at developing programs that run on the desktop, cloud (ie. web app), and other devices. I'm looking at how I can code this in C++ and be able to communicate to a server and/or to the client's computer. Is this even possible and do I need the server … | |
hey i wanna make C++ program that makes music files but i don't want to use the beep function because that's to simple..and as far as i know doesnt save as a music file....i've looked at csound but that looks a bit to tricky..can u suggest any library's that have … | |
I have been teaching myself algorithms and I am stuck with the AlphaBeta AI algorithm. I want to test my knowledge of it with a TicTacToe simulation. The thing is I want it to be easy to modify for any two player game and I cannot figure out how to … | |
i`ve done a few codes and i compile it so that i can review it but it got stuck when i want to assign a room. i dont know why.. can someone please help me to fix this please...[CODE]#include <iostream> #include <vector> #include <cstdlib> #include <set> #include <algorithm> #include <string> … | |
please help new to c++ programming in this program am trying to input 5 students information and get there output but i got wired error {illegal structure operation} [B]please help [/B] #include <iostream.h> #include <conio.h> struct student { int no; char name[20]; float degree; }; void main() { student s; … | |
This is the program I wrote for my CS project. Compiler is TurboC++. I initially added a lot of garbage code in it and am having a hard time cleaning it up. Can you guys please suggest improvements in the code below. Thanks in advance. [CODE] //STUDENT MANAGEMENT #include<conio.h> #include<fstream.h> … | |
I know there is an "assignable and copy constructable" requirement for objects in an STL container. For example, you cannot place an object with a const member into a vector. [code] #include <vector> // /home/doriad/Test/Test.cxx:3:8: error: non-static const member ‘const int MyClass::x’, can’t use default assignment operator // struct MyClass … | |
Recently I started working with game development and I came with a problem, when I started working with this SDL_image.h library and I can not understand why the program, does not display the image, screen just flashes and disappears, I can't figure out what's the problem. I am using Microsoft … | |
If I want to expose an iterator to a class member container, I can do so like this: [code] class PatchCollection { public: // Iterator interface typedef std::set<Patch>::iterator iterator; typedef std::set<Patch>::const_iterator const_iterator; iterator begin() { return SourcePatches.begin(); } iterator end() { return SourcePatches.end(); } private: std::set<Patch> Patches; }; [/code] However, … | |
Hi everybody, I am learning c++ and i want to develop GUI applications Is Directx efficient for GUI apps ? Not games, just gui software. thanks | |
I'm having trouble finding how to write to a C++ WinAPI TextEdit control programatically. Here is my code for the TextEdit control: [CODE] case WM_CREATE: { OutputBox = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL, 10, 90, 410, 235, hwnd, (HMENU)OUTPUTBOX, g_hInst, NULL); break; } … | |
Dear all, I'm a C++ beginner and I'm facing a problem with C++ program running on Dev C++ 4.9.9.2. The following program builds and compiles just fine however when I try to execute it it stops before getting any output. Actually the line causing the problem might be the "y_pos[][]" … | |
I have a class called PatchCollection. It is in charge of creating a bunch of Patch objects. It stores them in a member variable of type std::set. Now I want to loop over all of the patches from outside the class. That is: [code] MyClass { PatchCollection Patches; void DoSomething() … | |
OK, first off I have figured out the prime number algorithm...I guess. What I am needing help with, or wanting the answer to, is how to count how many primes are being displayed. To wit: Enter a Number: 10 There are 4 Primes. The Primes are: 7 5 3 2 … | |
Hello guys , I am looking for a HTML parser in C/C++. I am trying to make a movie rater , which take name of movies from a folder and stores it in a file , then sort it according to their rating on net. So ,I am thinking to … |
The End.