49,761 Topics
| |
Hi folks I'm trying to do my assignment in c++, I suppose to develope a maze traversal using backtracking algorithm. I have to write a constructor for my Maze with this sign. [CODE]Maze(**c, int size); [/CODE] which takes a n-by-n two-dimensional character array. Can you guide how can pass an … | |
I'm having problems with unique(). I have some code that goes something like this: [CODE]std::map<int, CompCont> sysRelMap; for each(pair<int, CompCont> comp in sysRelMap) { list<pair<string,string>>::iterator newEnd = unique(comp.second.connList.begin(), comp.second.connList.end(), equalPair); comp.second.connList.erase(newEnd,comp.second.connList.end()); }[/CODE] equalPair is a small, simple function: [CODE]bool ScriptWriter::equalPair(const pair<string, string> first, const pair<string, string> second) { return (first.first.compare(second.first) … | |
Hi! This will probably be an easy question to answer but the solution is eluding me. I just started writing c++ programs and they work fine on my computer (I use visual studio to compile them). the problem I am having is I would run my program on another computer … | |
I'm working on a program to save and load character files for a text-based RPG. There are three slots to save to. I'm having the user enter whichever slot he wants to save to through inputting an integer. If the number is lower than 1 or higher than 3 I … | |
My program reads water temperatures from a river as well as when the temps were recorded from an input file called "biodata.dat." Then the data is outputted in a file called "results.dat" (i havent added this results.dat part in my code but do know how to do it) The input … | |
[I]plz tell me how can i make software of calculator in c++. from smartboy shahzaib[/I] | |
So I am programming a binary to decimal conversion program... But the twist is, I want to Convert my input string to a const char, and from the const char I want to convert it to an integer... Because I can not just convert a string directly to a integer. … | |
Hello List, I'm creating a Button where I want to add a function setActionOnReleased(func aFunction); From any class I'd like to instantiate this Button class and send it the function I want to execute. I found some reference to using member function pointers ( [url]http://bytes.com/topic/c/answers/569262-passing-function-argument[/url] ), but I'd like to … | |
Ok I feel like this may be a dumb question, but I'm putting it out there anyway. It's been a while since I've worked with C++. What characters does C++ print for negative values of char? Positive values seem to follow ASCII, but ASCII is only 128 characters. So where … | |
I am using the Direct2D API to draw some graphics for my program. I have a function that I call every time the Window redraws that draws the frame. I can't hardcode every object to be drawn into the function, if I want it to be dynamic. What is the … | |
#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} } | |
Hi, After a year of using c# and gaining object programming experience I decided to improve my c++ skills. What I particularly liked about c# was the way of dividing source into different files. It all just worked fine :). Now I want to do the same using c++. I'm … | |
Hi, I'm an experienced developer but not done much in c++ and wanted to get some basic database operations in my program, open, store, retrieve etc. Does anyone have any good links that could get me started? Thanks Baden | |
#include<iostream> using namespace std; class alpha{ private: int data; public: alpha(){} alpha(int a){data=a;} void display(){ cout<<data; } alpha operator =(alpha& a){ cout<<data; data=a.data; cout<<"\n assignement operator invoked"; return alpha(data); // is temporary object created is returned to a2 object ?//why it can't be returned by reference?what is the difference b/w … | |
can you help me out in solving this problem... i'm in my 1st year college with the course of info tech... i'm having problems on solving this.. develop a program that will dtermine the gross pay for each of several employees. the company pays " straight time" for the first … | |
i have a text file with known format. which is as fallow code ItemName Quantity 001 ABC 45 002 BCA 5 003 ACB 10 i want to [B]read and write[/B] the line [B]randomly[/B] according to the [B]need of a user[/B]. for example if user want to read the data of … | |
can i declare operator overloading function as a friend function? i did it and i get errors #include <iostream.h> class time { int h; int m; friend time operator +(time); public: void input(); time(); time(int,int); void display(); }; time::time() { h=0; m=0; } time::time(int a,int b) { h=a; m=b; } … | |
[code] #include <iostream> #include <fstream> #include <string.h> #include <ctype.h> const int SIZE=100; using namespace std; class Person { private: char name[30],address[50],phone[11]; public: friend ostream &operator << (ostream &os, Person &p); friend istream &operator >> (istream &is, Person &p); friend ofstream &operator << (ofstream &fos, Person &p); friend ifstream &operator >>(ifstream … | |
Hi All, I am new to C++. I am practicing loops and i need some help. This one behaves strangely. What i want is for this loop to accept numbers from 1 to 4 for options (strictly numbers) and no other characters. When executed and run, if the input is … | |
Let me tell u, that I AM A NEWBIE to C++.. I want to use sound in C++ (I use Borland Turbo C++ 4.5 because, this is used in our college..) To use sound files, I browsed net and came to know that we may play sound using the sound(), … | |
hi,, i am new to cimg how can i get and also set the coordinates of the image using cimg? i searched a lot but could not find it out thanks | |
Hi. I have a character array of the form "0abcdef" or "1defghi". I have to remove the first character and convert the rest to a string. So in this case, the strings would be abcdef and defghi. I know that saying string s(char array) does a direct conversion but I … | |
| hi!! I installed TurboC++ version 3.0 in my computer, which runs a WindowsXP OS.... the problem is... the turboc++ window opens in my screen but i am not able to use my keyboard as well as my mouse within its window, hence i am not able to work with it … |
hey guys im trying to write a simple program for displaying an image using opencv libraries but the program never compiles.. it says no such file or directory 'highgui.h' .. ive tried reinstalling and configuring both devc++ and open cv about twice but to no avail.. ive downloaded the latest … | |
I'm having trouble even beginning to GUI program in C++. I'm using DevC++ with WX widgets and I've downloaded the DevPac. I really need something to help me understand the basics. For example. How would one go about creating a project and programming a GUI applicatin. Also, when you compile … | |
I'm working with some objects given to me by the API for an architectural modeling program. When navigating the model, I get a set of Component objects. One of the data members of these Component objects is a set of Interface objects. I'm looking to search for a specific Interface … | |
Who make better programmers? Men or Women? :) Just curious coz all around the world, in academics, women surpass men. But in this field, i guess its men :). What you say? I am a male by the way! | |
Is there any concept of pure virtual destructor in C++? | |
Hello, Is the endianess can be for the nibble boundaries ? Because i have defined a class, and try to access the array with a pointer of class type. typedef unsigned char uint8; class A{ public: uint8 a:4; uint8 b:4; }; int _tmain(int argc, _TCHAR* argv[]) { uint8 temp = … | |
Hi everyone. Today i have been playing with templates and decided to make a generic question and answer function using templates to allow you to choose the return type for each call. Code below. [code] template< class T > T qAndA(const std::string Question,const T retType) { T retVar; std::cout<<Question<<std::endl; //ask … |
The End.