49,761 Topics

Member Avatar for
Member Avatar for phalaris_trip

I'm trying to make the second parameter a default parameter that is the same as the first, or different if I want it to be different.. Why doesn't this work? And is there a way around it, other than by iterative overloads? void LoadFile (std::string filename, std::string key=filename) { //blah …

Member Avatar for phalaris_trip
0
115
Member Avatar for toko

I have been reading "Sams Teach Yourself C++ in 24 Hours". This is the code that has confused me: [CODE=c++] #include <iostream> class Cat { public: int GetAge(); void SetAge (int age); void Meow(); private: int itsAge; }; int Cat::GetAge() { return itsAge; } void Cat::SetAge(int age) { itsAge = …

Member Avatar for Max_Payne
0
103
Member Avatar for Karkaroff

Please help me in self documenting the program below. All u have to do is, take a quick glance at the following code to see if u can understand wat each part is doing. If u have any difficulty in understanding(at a quick glance that is!), pls tell me so …

Member Avatar for n.aggel
0
297
Member Avatar for daino

Hi I'm wondering why you would learn C++ for use in finance when you can do so many calculations on an excel spreadsheet and use VBA. I am not an expert on either though could someone tell me why C++ is better and if not why excel and VBA is …

Member Avatar for dubeyprateek
0
233
Member Avatar for Karkaroff

i made a program to evaluate an expression, "expeval.cpp" [find attached]. i then tried to go further..... i made the program to read characters from the keyboard and write it into a file["file.cpp",find attached]. if an expression is encountered, it is evaluated and the result is displayed after the line …

Member Avatar for Karkaroff
0
110
Member Avatar for #include<DAN.h>

I want to how to use a character that isn't on the keyboard in the out put of my program. I've gone into eudcedit.exe to create characters that I want to use in my program and saced them under the font that I use for output, but what I want …

Member Avatar for Salem
0
121
Member Avatar for richasr1

Hey, I've been using c++ builder and ive hit a snag. I'm creating a very simple program that will allow you to manipulate shapes; each shape has the same mousedown properties as every other shape. What i want to do next is to use a settings dialogue box to set …

0
69
Member Avatar for naveed.pasha

Hi all! I've started a little late doing my final year university project, but I know what I want to do so it's probably better than a few of the other students out there! I do enjoy reading and studying about the wide variety of topics that are encompassed by …

Member Avatar for Salem
0
576
Member Avatar for mr.cool

i have a question, why can't i do this, there are three errors and i don't know what they mean [code] #include<iostream.h> float celsius_to_fahrenheit(float); int main() { float fahrenheit; float celsius=22.5; fahrenheit=celsius_to_fahrenheit(celsius); cout<<celsius<<"C="<<fahrenheit<<"F\n"; return 0; } celsius_to_fahrenheit(float celsius) { return(celsius*(9.0/5.0)+32.0); } [/code]

Member Avatar for Narue
0
94
Member Avatar for peeta

hello again i have mac computer and i have xcode on it. i am looking for some use full beginners books or tutorials. Right from start i have no previous knowledge of c++. can any one suggests any book for site for beginners which specially deal with g++ and xcode. …

Member Avatar for peeta
0
118
Member Avatar for That Asian Guy

I was trying to delete the currently selected listview item using MFC methods, but obviously they werent compatible How can I accomplish this in VS 2005 (standard .NET windows forms NOT MFC? I have tried [code=C++] void CMyListView::DeleteSelectedRow() { int nIndex = GetListCtrl().GetSelectionMark(); if(nIndex != -1) { GetListCtrl().DeleteItem(nIndex); } } …

Member Avatar for That Asian Guy
0
97
Member Avatar for Blondeamon

Ok i'll try to be brief. As part of one of my essays i thought of creating source code for implementation of a binary tree and its basic functions. My code is both from books,lecture notes and googling but for some reason on the printing of the nodes using inOrder …

Member Avatar for Blondeamon
0
94
Member Avatar for djJonno

Hi, I've now spent hours looking at this and no joy, wondering if any of you guys can help. I am passing an object that uses dynamically allocated memory into a method, but for some reason when it finishes my original object has changed/been destroyed. header file: [CODE=cpp] class Multiset …

Member Avatar for djJonno
0
357
Member Avatar for TimeIsCyclical

I'm creating a billing program for my college's print shop. I'm doing this with a class called "orders" that signifies each new order that is taken. I'm having trouble figuing out how to create new variables of that class without prompting the user to input anything though... After the previous …

Member Avatar for Bench
0
97
Member Avatar for zaks

i have no previous knowledge of c++ and im trying to make a program to click on a certain color loaded from a bitmap and wait for action to finish another question is what is a good program to run c++ i have notepad++ it seems good to write them …

Member Avatar for WolfPack
0
132
Member Avatar for TheBeast32

Hi, i have been making a program that tests a computer owner's firewall. It gets input from the client i made, and does a system() with it. Is there any way to make the firewall not block the program right when i make a scocket? Oh, im using Dev-C++ 4.9.9.2 …

Member Avatar for WolfPack
0
339
Member Avatar for Tiger909

[B][COLOR="Red"]hi all, I am new here,and I wish I could find a solution for this program My program has to check if the number is prime or not?, my program is working properly with numbers greater than 1 (n>1), I want my program to display a friendly message when the …

Member Avatar for invisal
0
164
Member Avatar for Max_Payne

[B]Point.h[/B] [code=c++] #prag... #pragma once #include <iostream> using namespace std; class Point { private: int x; int y; public: Point(void); Point( int x, int y ); Point( const Point &xPoint ); ~Point(void); void setX( int x ); int getX() const; void setY( int y ); int getY() const; Point & …

Member Avatar for Max_Payne
0
583
Member Avatar for zoner7

[CODE] #include <iostream.h> #include <time.h> #include <stdlib.h> #define MAX_RANGE 1000 main () { long value, guess; int tries = 0; srand ( time (NULL) ); // Initialize random generator value = rand()%MAX_RANGE+1; // Get random between 1 and MAX_RANGE cout << "A random number has been selected between 1 and …

Member Avatar for kv79
1
380
Member Avatar for jbennet

Okay i need some help doing a payroll system using master/transaction files in C++. I have done the pseudocode (we will use text files to simulate tapes) can anyone see any probs with my pseudocode? how would i do it in c++? [code] ======================== get payroll transaction file for $month …

Member Avatar for jbennet
0
118
Member Avatar for djJonno

Hi, Just a short question. I was wondering if one has a base class for example bird and a derived class pigeon, if i instantiate an object of each class, B1 and P1. Is it possible to pass the address of B1 or P1 into a function such as DoSomething(&B1) …

Member Avatar for djJonno
0
278
Member Avatar for delta_simon

Hi I am very new at c++ but could someone help me with this. I have a file with source code that show images on the screen. I want to know how ti make it show a playng card instead of the image. The task is (what I believe) to …

Member Avatar for Ancient Dragon
0
58
Member Avatar for rlupton313
Member Avatar for Ancient Dragon
0
79
Member Avatar for lifei

Can i know what's wrong with the below source code? can i put the variable x, y like this? How it can't work? [code=c++] #include <Windows.h> #include <mmsystem.h> #pragma comment (lib,"winmm.lib") int ,x,y; void CTestingDlg::OnPlay() { // TODO: Add your control notification handler code here UpdateData(TRUE); CString strFreq; CString strHL; …

Member Avatar for invisal
0
148
Member Avatar for Nosgammot

Hello, I am just starting to learn C++ and Decided to change from using Dev-C++ to Visual C++ 2008 express. but, there seems to be a problem.After compiling a few programs and showing off my new skills to my friend over MSN he tells me that he cant run my …

Member Avatar for n.aggel
0
143
Member Avatar for wega

plz i realy do need help:D i only want to read the contents of a text file but i dont know how:( ex: test.txt how to read its contents

Member Avatar for Comrade Ogilvy
0
104
Member Avatar for kv79

Hi to all, I want to know how to get into dll file. I do not now anythig about dll. I do now something about Applications. So if you can give some link with example and with dllEntryPoint i will send the GOD's to Answer your wishes(:D).I have nothing to …

Member Avatar for kv79
0
205
Member Avatar for Deadvacahead

Howdy, I am trying to write a program that reads in a .txt file with questions and multiple choice answers. The program then needs to search the text and convert the questions into a new format and write to a new file. I don't have much so far because I …

Member Avatar for n.aggel
0
155
Member Avatar for toolmanx

I recently sent a request for help because ReadFile kept crashing for me. The moderator sent me some code which cured my problem. My next step was to experiment to see what I had originally done wrong. (For further info see ReadFile crashes by toolmanx.) I started by replacing each …

Member Avatar for Comrade Ogilvy
0
128
Member Avatar for xeption12

Ok i'm trying to build a header file which then i can include it for programs that use singly linked lists but somthing is fishy here...: here's the code [CODE]#include <iostream.h> struct nod { int info; nod* next_adr;}; void add(nod* &v, nod* &sf, int val) { nod *c; if(v==0) //if …

Member Avatar for xeption12
0
90

The End.