49,761 Topics

Member Avatar for
Member Avatar for ehsantl

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 …

Member Avatar for mrnutty
0
799
Member Avatar for therobot

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

Member Avatar for arkoenig
0
134
Member Avatar for spamwich56

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 …

Member Avatar for treasure ola
0
112
Member Avatar for ichigo_cool

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 …

Member Avatar for ichigo_cool
0
106
Member Avatar for jelinky

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 …

Member Avatar for jelinky
0
92
Member Avatar for shahzaib g

[I]plz tell me how can i make software of calculator in c++. from smartboy shahzaib[/I]

Member Avatar for NicAx64
0
84
Member Avatar for CzechRock3

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

Member Avatar for CzechRock3
0
401
Member Avatar for 344server

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 …

Member Avatar for 344server
0
254
Member Avatar for EvolutionFallen

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 …

Member Avatar for EvolutionFallen
0
108
Member Avatar for fuggles

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 …

Member Avatar for mike_2000_17
0
98
Member Avatar for coolboss

#include<iostream> using namespace std; void main() { int pro[100]; for(int a=100;a>=1;a--) { pro[a]=a; cout<<pro[a]<<"\t";} }

Member Avatar for arkoenig
0
115
Member Avatar for gisek

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 …

Member Avatar for gisek
0
137
Member Avatar for badenpearce

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

Member Avatar for Stefano Mtangoo
0
367
Member Avatar for saransh60

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

Member Avatar for Narue
0
116
Member Avatar for cuteyginx

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 …

Member Avatar for Ancient Dragon
0
99
Member Avatar for kashifboy

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 …

Member Avatar for Narue
0
84
Member Avatar for y2kshane

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

Member Avatar for Stefano Mtangoo
0
292
Member Avatar for srivardhanms

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

Member Avatar for mike_2000_17
0
2K
Member Avatar for newbie_to_cpp

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 …

Member Avatar for ceriamultimedia
0
99
Member Avatar for skshoyeb

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(), …

Member Avatar for skshoyeb
0
493
Member Avatar for mrkaran

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

0
58
Member Avatar for AutoC

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 …

Member Avatar for AutoC
0
215
Member Avatar for ak_2005

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 …

Member Avatar for shriniwas
0
5K
Member Avatar for mrkaran

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 …

Member Avatar for NicAx64
0
180
Member Avatar for daino

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 …

Member Avatar for Stefano Mtangoo
0
943
Member Avatar for therobot

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 …

Member Avatar for therobot
0
104
Member Avatar for newbie_to_cpp

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!

Member Avatar for NicAx64
0
107
Member Avatar for harris21
Member Avatar for pdk123

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

Member Avatar for pdk123
0
139
Member Avatar for Kanoisa

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 …

Member Avatar for mike_2000_17
0
134

The End.