51,593 Topics

Member Avatar for
Member Avatar for vidyaj

hi all, i need a c++ code to display a non binary tree. it should be used with STL multimap.. please help me to find the same..

0
21
Member Avatar for PixelExchange

Hi everyone.. I've recently switched over from Visual Studio 6.0 to visual Studio 2010.. The problem is studio 2010 does not have an "execute .exe button," as version 6 does. Is there a way to manually place an execute .exe button inside of visual 2010?

Member Avatar for PixelExchange
0
111
Member Avatar for kemooo

Design and write a program to calculate the third angle and the other two sides of a triangle. The input to the program is the length of one side a (unit not important) the sizes of the two angles adjacent to that side B, C degrees An important point that …

Member Avatar for mrnutty
0
121
Member Avatar for Bigbrain99

[CODE]void addname(string name) { ofstream myfile(CONTACTS,ios::app ); myfile.open(CONTACTS); if (myfile.is_open()); { myfile<<i++<<name<<endl; myfile.close(); } }[/CODE] Initially the codes just kept on overwriting the existing file, but after that i was told to put ios::app. However, it is still now working....now even worse...ofstream is not even writing the file...hellp..

Member Avatar for Bigbrain99
0
117
Member Avatar for camcam08

i have an error on this code i cant open example.txt using my declarations. #include <fstream> #include <iostream> #include <string.h> #include <time.h> #include <string.h> using namespace std; int main() { char time[9]; char date[9]; _strtime(time); _strdate(date); string nop; nop = "example.txt"; ofstream dtfile(""nop"", ios::app); dtfile<<time; dtfile<<" "<<date<<endl; dtfile.close(); }

Member Avatar for mrnutty
0
80
Member Avatar for come_again

Hello everyone, I don't have much experience with C++ and it has been a while since I have last used it. Right now I am writing my own class for quaternions. My problem which I cannot figure out is what is wrong with the operator overload shown below... No matter …

Member Avatar for StuXYZ
0
173
Member Avatar for Bigbrain99

when i tried to compile it, why i got expected primary-expression before input? [CODE]#include "mylibrary.h" #include "contadd.h" //for function declaration void Contact::setname(string name) { ofstream myfile; myfile.open(CONTACTS); if (myfile.is_open()); { myfile<<name<<endl; myfile.close(); } i++; } int main(int argc, char* argv[]) { vector <string> input; Contact addingname; if (argc == 2) …

Member Avatar for Bigbrain99
0
333
Member Avatar for enkidu75

I need to write a program for class. I'm not necessarily looking for code, just help. I need to file input data in this format: 01 - 00:53 - 70 01 - 02:45 - 50 01 - 03:31 - 79 01 - 04:30 - 56 01 - 05:55 - 59 …

Member Avatar for mrnutty
0
116
Member Avatar for gaishi

Hello, everyone I just wrote a program by using vc 2010 and it won't compile. The reason was 1>------ Build started: Project: 17, Configuration: Debug Win32 ------ 1> 17.cpp 1>c:\users\yuan\documents\visual studio 2010\projects\17\17.cpp(101): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 1>17.obj : error LNK2019: unresolved …

Member Avatar for NicAx64
0
194
Member Avatar for Bigbrain99

When i tried to compile it, it gave me this error "no match for operator". Any idea how could this happen? This program will take user input and add it into dat file [CODE]#define CONTACTS "contacts.dat" #include <iostream> //enable the used of cin and cout #include <fstream> //enable writing file …

Member Avatar for Bigbrain99
0
225
Member Avatar for ranvi

Hi All, I need your help regarding valgrind issues. I have pasted a snippet of code, (not compilable version) which gives the idea of what I am doing. Basically, I have a parent and child process. Child process is running infinite loop (server). Parent process at the end, kills the …

0
56
Member Avatar for mike42intn

I am trying to make this project and im very new to this but i really want to learn this can anyone check this code for me and tell me whats wrong with it. I have to get it to add 2 fractions display result then display result in decimal …

Member Avatar for mike42intn
0
154
Member Avatar for clb8372

[CODE]For each of the following problems, use the top-down modular approach and pseudo code to design a suitable program to solve it. 1. Input names of students from the user, terminated by ZZZ, and create a data file GRADES with records of the form: student (string), test1 (integer), test2 (integer), …

Member Avatar for UnderAshes2008
0
504
Member Avatar for gianks

Hi all, i've to make an introduction of what am i doing before start making questions. The goal of my work is to create an application quite like an IDE, for specific program development ( always in C++ ) and testing. Since the need of execute these programs under the …

0
132
Member Avatar for Bigbrain99

currently I'm building a program which can take people contact and add it to a dat file. However, when I tried to run the program, i got this error: invalid types ‘<unresolved overloaded function type>[int]’ for array subscript [CODE] class Contact{ private: int phones; string email; string name; public: void …

Member Avatar for Bigbrain99
0
5K
Member Avatar for taylar

I want to learn C++ but there are so many poroblem in undersatnding this. plz send me some places list where i can learn C++ so fast... Thnks =============taylar [URL="http://autotradeinsurance.com"]Auto Trade Insurance[/URL]

Member Avatar for creeps
-1
129
Member Avatar for NordCoder

I am making an Asteroids clone using SDL and OpegGL in C++. Like most games, I needed to render text and after some hassle with SDL_ttf, I decided to try FTGL which uses Freetype2. I am using Visual Studio C++ 2008 Express Edition. There is no precompiled library included in …

Member Avatar for NordCoder
0
615
Member Avatar for jay-tee

i have use a column of called driverIdnumber and have a Date of birth in a new column using ID number of the driver,please help katimaDM - is my data module katimaDM->tblDriver->edit(); katimaDM->tblDriver->field->fieldbyName("DriverDOB")->AsAnsiString = ............//this part im lost katimaDM->tblDriver->post();

Member Avatar for jay-tee
0
86
Member Avatar for ymb6

1. Discuss the concept of arrays of objects. Give examples (10 marks) 2. Write a program to get the average of 10 random numbers given by the user (10 marks) 3. List and describe the arithmetic operators available in C++ (5 marks) 4. List any benefits of Object Oriented Programming …

Member Avatar for Fbody
-3
316
Member Avatar for prit05
Member Avatar for Duki
0
180
Member Avatar for whelhelmsoriano
Member Avatar for sfuo
0
78
Member Avatar for michdd

I'm trying to create some type of callback system for events. I have a function where I'm attempting to set a member to a pointer to a function but I'm receiving an error. This is what I attempted to do: [CODE]void (MyClass::*test)() = &MyClass::TestCallback; EnterButton->SetCallback(test);[/CODE] And then in the class …

Member Avatar for mike_2000_17
0
189
Member Avatar for mommabear

[COLOR="Green"]Hello I've just joined this forum, although I have used it regularly in the last couple of months to help in my learning of programming. I have learned a lot (I feel), and I'm now hoping to not only resolve the errors I have in my coding, but to gain …

Member Avatar for mike_2000_17
0
351
Member Avatar for kenn1213

Im not really in the major of c++ or I.T i need your help [B]The Fibonacci Sequence it must lead the sequence 0,1,1,2,3,5,8,13,21.... A program that will generate a Fibonacci of a specified length given the first 2 numbers in the sequence. First input an integer N that specifies the …

Member Avatar for kenn1213
0
176
Member Avatar for dflatt

i keep having a problem with my arrays. when i set them up and try to re-use them elsewhere i only get the last part of the array and all the rest are pointers. [CODE] typedef int* ptr; ptr sub;//dynamic int count = end - start; //the sub-array's size is …

Member Avatar for dflatt
0
72
Member Avatar for HumanBeing86

here is my codes, i plan to output the name and the weight. but no matter i try many time it still give me an output only output should be this-> Name = Meow Weight = 10.5 whereas what am I getting is Weight = 10.5, why? thx [CODE]#include <iostream> …

Member Avatar for vijayan121
0
152
Member Avatar for Bench

For anyone who gets fed up with the somewhat verbose syntax involved in populating an STL map container with static arrays of std::pair (Or any of the other somewhat tedious ways of writing 'pair' combinations), here is a function which allows two different (statically allocated) arrays, of equal length, to …

Member Avatar for vijayan121
0
2K
Member Avatar for HumanBeing86

hmm....why I can't get the output?? any wrong ?? thx for helping... #include <iostream> using namespace std; const int SIZE = 3; class Course { string* students; public: Course (string* students); ~Course (); void print(); }; Course::Course (string* students) { students = new string[SIZE]; for(int i=0; i<SIZE; i++){ students[i]=Course.students[i]; } …

Member Avatar for NicAx64
0
155
Member Avatar for HumanBeing86

Hi all... I am a new c++ learner. I'm facing a little problem. according the code below I try to display the output from the loop... but no matter how I trying it still can not work.... here is my codes... anyone can tell me which part am I wrong …

Member Avatar for Fbody
0
137
Member Avatar for embooglement

I'm developing a game engine, and set up a function that uses string streams to convert various values into std::string's. To use this to string function on class obviously takes an overloaded insertion operator, which I have done for a transformation matrix class here: [code] typedef std::stringstream StreamString; StringStream& operator<<(StringStream& …

Member Avatar for embooglement
0
2K
Member Avatar for clarkeboy

How Can I use Clear screen and jump to next line?? like for example. press enter y for yes and n for no to proceed to next line and next screen.

Member Avatar for GuitarComet
0
190
Member Avatar for archana.c07

Hi all, I am trying to implement singleton class having static method. my requirement is as below: A.h Class A{ Public : Static A* getInstance(); } B.cpp #include A.h Class B : public class A{ A* A::getInstance() { //some code. Return *A } } D.cpp #include B.h A* pter = …

Member Avatar for archana.c07
0
101
Member Avatar for new_tonio

Q: Can anyone estimate what is the running time(average or approx) in minutes on getting one knights tour using recursive backtracking on a P4@2.2Ghz? i'm running my code in a pc with core2duo2.0Ghz and it is running for 13hrs up to the time i started this thread... thanks

Member Avatar for tesuji
0
56
Member Avatar for mrkaran

i have a piece of code: [CODE] struct myKeyword { string name; int id; }; myKeyword keywords[]={{"include",INCLUDE}, {"void",VOID},{"main",MAIN},{"int",INT},{"float",FLOAT},{"cin",CIN},{"cout",COUT},{"if",IF},{"elseif",ELSEIF},{"else",ELSE},{"exit",EXIT},{"for",FOR},{"while",WHILE}}; int j=0; cout<<keywords[0].id; //not able to access keywords.id part flag=0; for (j=0;j<11;j++) { if (lexeme==keywords[j].name) { temp->assign(lexeme,keywords[j].id); flag=1; break; } } getchar(); }[/CODE] why cout<<keywords[0].id is not working? thanks in advance

Member Avatar for mrnutty
0
130
Member Avatar for vbx_wx
Member Avatar for mrnutty
0
101
Member Avatar for gallantlex

Firstly, Here's my code running in VS 2010 [CODE=c] #include <iostream> #include <fstream> #include <string> #include <list> using namespace std; class Student { friend ostream& operator<<(ostream&, Student); friend istream& operator>> (istream&, Student&); private: int stuId; string name; int gpa; public: Student(int, string, int); int getStudId(); }; ostream& operator<<(ostream& out, Student …

Member Avatar for gallantlex
0
968
Member Avatar for y2kshane

what is marco in c++ i have no idea about this plz give simple answer (im new to c++) thanx :)

Member Avatar for NathanOliver
0
62
Member Avatar for apple621

Write a function whose prototype is string NumberToName(int x); that returns the string of english name of each digit of number x. Using this function, write a main program that reads a positive integer number and prints the english name of each digit of that number in a single line …

Member Avatar for programing
0
133
Member Avatar for calamaris

Hi every one . in default cursor move from left to right how can i change direction of cursor in my program int main() { char tile[NO_OF_COLS][NO_OF_ROWS]; char ch1,ch2; int counter = 0; system("MODE CON:COLS=80 LINES=50"); gotoxy(35,25); do { cout <<"#"; Sleep(200); ++counter; }while(counter <=100);

Member Avatar for Ancient Dragon
0
38
Member Avatar for nocloud

I currently have two C++ programs. Program1 takes some input and prints to screen a float. I can get Program2 to call Program1 using something like: system("./program1 input"); Currently, Program1's output goes to screen. Is it possible for Program2 to read Program1's output and use it? The only way I …

Member Avatar for Ancient Dragon
0
93
Member Avatar for skyyforever

Hello, I have a problem opening Excel file which I have created using a xslt. Actually, I had a xml file which I transformed to an excel file and saved. I don’t know how to open it. Everything I have tried, didn’t work. Please, if someone knows the answer...

0
82
Member Avatar for Duki

For whatever reason, I can't figure this out. I'm getting this error: [quote]error C2082: redefinition of formal parameter 'user' [/quote] In this code: [code=c++] #pragma once #include "Standard Libs.h" #include "Ability.h" #include "Spell.h" #include "Item.h" class Adventurer { private: string name; int level; int xp; int gold; int attack; int …

Member Avatar for Duki
0
101
Member Avatar for frogboy77

Hi, total beginner here, trying to learn at home. Just thought i'd get that in. if i have a number eg 123 trying to figure out a way of calculating all the possible cominations 123 132 213 231 312 321 can do it with pencil and paper but don't know …

Member Avatar for frogboy77
0
84
Member Avatar for ramesh.goli

Hi, Can cany one explain me virtual table architecture & functionality internally?

Member Avatar for Frederick2
0
47
Member Avatar for cgcgames

I am Working on Conecting to a database in windos forms C++. I use MVC++. here is a link to my DB file so people can see what i have tried to do in the DB. [URL="http://www.mediafire.com/?yfr52oqcknakk9g"]http://www.mediafire.com/?yfr52oqcknakk9g[/URL] you need access to see this. i have finaly figured out how to …

Member Avatar for cgcgames
0
201
Member Avatar for ftl25

Hi folks, I am writing an application in C, but I have the OOP functionality that C++ provides. (i.e., I can only use C library functions). I have a function as follows in TSL1.cpp: [CODE] void TSL1_ExecuteTest (char *sCmdInt[]) /******************************************************************************* Name: TSL1_ExecuteTest Description: This function executes tests from current TSL1 …

Member Avatar for ftl25
0
186
Member Avatar for mahsa.ehsani

i want code of diomand program..you know a code that give us this: 1 123 12345 123 1

Member Avatar for Nick Evan
0
30
Member Avatar for tehmarto

Hello, I wanna write an anticheat for a game. So it seems that the cheat itself is editing the memory (for example movement speed). So what I'm gonna do is make my anticheat tool to scan the memory offset and compare the value in the memory to the normal value …

Member Avatar for tehmarto
0
239
Member Avatar for DBlue

Hi there. I am just learning vc++ and it's all new to me, so I need a bit of help. This could be a daft question, but where do i put my user code to initialize a USB port? I can see where the button click functions are, but where …

Member Avatar for mike_2000_17
0
122
Member Avatar for Haxifix

My friend and I were making a pac man console game in C++, and we can't seem to get the AI we wrote for our ghosts to work properly [code] #include <iostream> #include <Windows.h> using namespace std; struct Player { int x, y; Player() { x = -1; y = …

Member Avatar for Haxifix
0
936

The End.