49,761 Topics
| |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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] | |
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. … | |
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); } } … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
[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 & … | |
[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 … | |
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 … | |
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) … | |
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 … | |
Need some help writing a program to find the area of a right triangle without using fstream, iostream, etc. | |
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; … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … |
The End.