49,761 Topics

Member Avatar for
Member Avatar for Purrenhage

2 week in programming I am learning to program in C++. I started off with 26 error, and now I am down to 1. I just dont understand what it is asking for in the errors. Can somebody help me out? I have tried to look on the internet but …

Member Avatar for manojwali
0
151
Member Avatar for qvyhnl

I had created a Person class with 2 fields ages and name, its member functions are [CODE] Person::Person(string n, int a){ name = n; age = a;} string Person::get_name() const{ return name;} void Person::increment_age(){ age += 1;} void Person::print() const{ cout << name << endl; cout << age << endl;}[/CODE] …

Member Avatar for qvyhnl
0
146
Member Avatar for SgtMe

Hi all. There have been several threads where people are asking, [B]"is there any way we can develop iPhone Apps on Windows, or without using Objective-C?" [/B]The main reason people ask this is because [I]they either cannot afford a Mac, or cannot afford all the additional costs one has to …

0
185
Member Avatar for amoon wasfi

Here is the question: Write a program that outputs the following Pascal triangle using two nested for loops. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 …

Member Avatar for Dakurels
0
148
Member Avatar for dspjm

Suppose I have these two functions: [CODE]template<class T> bool largerthan(T a, T b) { if(a>b) return true; return false; } template<class T> int reduce(T ar[], int n) { list<T> buffer; buffer.insert(buffer.begin(), ar, ar+n); [COLOR="Red"]buffer.sort(largerthan);[/COLOR] buffer.unique(); copy(buffer.begin(),buffer.end(), ar); return buffer.size(); } [/CODE] I have two kinds of arrays for reduce(): string …

Member Avatar for vijayan121
0
105
Member Avatar for mumar
Member Avatar for Anuradha Mandal
-3
71
Member Avatar for modesto916

Hi, I know that there are many topics about this, but, i read a lot of them, and no one solved my problem. I doing some exercises of the book "Deitel How to Program, 5", and in the exercise 4.27 i need to write a program that get a binary …

Member Avatar for modesto916
0
95
Member Avatar for BlueZephyr

I have a list of things of things I need my code to do but I don't know where to begin. I need to: -Read the first line of a file which gives the number of grades in a set. -Transfer everything in a input file to and output file …

Member Avatar for tkud
0
187
Member Avatar for baconswife

My program is supposed to open files, initialize variables, use the functions sumGrades, averageGrade and printResults. I am having some errors and was hoping someone could help me out. To begin with some errors I'm getting are: line 10- two few arguments to function 'void printResult(int, int, float, float, float, …

Member Avatar for VernonDozier
0
323
Member Avatar for Miyamoto

insertion into a set takes O(log n) time, which means ? I have heard about big O notation which desribes how memory usage changes when input changes. But log n ? n is probably the number for input values but i don't get it let's say i have 25 inputs …

Member Avatar for arkoenig
0
976
Member Avatar for VasquezPL

My menu function looks like this and it works great: [code] int menu(string * teksty, int ile) { static HANDLE h_we = GetStdHandle(STD_INPUT_HANDLE), h_wy = GetStdHandle(STD_OUTPUT_HANDLE); int wybor = 1; CONSOLE_CURSOR_INFO cci = {0}; GetConsoleCursorInfo(h_wy, &cci); cci.bVisible = false; SetConsoleCursorInfo(h_wy, &cci); COORD p = {0}; DWORD k; //FillConsoleOutputAttribute(h_wy, 0x07, 80 …

Member Avatar for VasquezPL
0
155
Member Avatar for learningcpp

Hi, I am new at CPP. I am trying to create a list using STL. I was looking at the pop_back() method, and it says that it delete the element from the list and also calls it's destructor. so myelement = list.back(); i can access it. list.pop_back() will delete the …

Member Avatar for Dakurels
0
129
Member Avatar for batchprogram

I recently made a switch to SDL as a cross platform alternative to directly accessing DirectX or OpenGL. In an attempt to port a section of my game framework, I encounter logic errors that (to me) make absolutely no sense. In this snippet, a sprite is simply a wrapper class …

Member Avatar for venomxxl
0
205
Member Avatar for Weird Nerd

Hi, I need some help with my C++ program. I've got these custom-made PlaySound(char[MAX_PATH]) and PlayMusic(char[MAX_PATH], bool) functions that use the BASS sound engine. When I call an instance of OPENFILENAME (found in the samples), the sound (.wav and .mp3) plays perfectly. My problem is that once the sound declared …

Member Avatar for Weird Nerd
0
324
Member Avatar for beatenbob

Hi all, I know this is a trivial question but I really got stuck. I keep getting "non-1value in assignment" when trying to access the pointer variable "next" using the getNext() function. It didn't show any error if I change the last 2 lines to [CODE] temp_ptr->next = after->next; //when …

Member Avatar for jonsca
0
370
Member Avatar for DaveJohnson

I need to learn how to create a bot and would deeply appreciate any help I can get. The bot needs to be able to do specific operations at the same time(s) each day: (1) Click on a button; (2) Click on another button; (3) Fill in specific values in …

Member Avatar for jonsca
0
155
Member Avatar for digan

Hi, i have to write a program that gets users to enter some numbers and it has to sort them in descending order. I've nearly finished but i just cant get it to sort in descending order, only ascending (using bubble sort). Here is the program: [CODE]#include <cstdlib> #include <iostream> …

Member Avatar for Anuradha Mandal
0
2K
Member Avatar for triumphost

KK the code below is a loop part of my main program I just cut it out and made it compilable.... This is the problem... When the user enters a number greater than 2, its supposed to tell them to retry because that was not in the options menu... that …

Member Avatar for WaltP
0
164
Member Avatar for Rez11

I'm having problems with the code from my text book. I need modify the class so it throws an exception instead. The problem is that I get errors from the original code from the book. Any help on how to fix it would be great. Thanks in advance! ERROR: [COLOR="Green"]Error …

Member Avatar for Rez11
0
1K
Member Avatar for frogboy77

Hey, i know this is a commonly asked question (and will probably get burned for asking it again) but wanted an up to date answer so here we go. I'm trying to learn to program in c++ purely as a hobby. I have recently spent some time doing problems at …

Member Avatar for gerard4143
0
220
Member Avatar for ChaosKnight11

So I started with C++ recently, and it's still very new and difficult for me but I think I'm starting to get the hang of it. Now I want to start making my first real-world app. I downloaded an SDK for a mobile application API and I want to make …

Member Avatar for Stefano Mtangoo
0
143
Member Avatar for shakssage

I can't think of a way to get rows out of a table. It was easy doing it with VB.Net and I'm just finding vc++ really difficult. This is what I have so far. I've connected to the database file and I am able to get the data shown onto …

Member Avatar for Stefano Mtangoo
0
259
Member Avatar for vbx_wx

Is there any diference between: [code] X* x = new X; X* y = operator new X; [/code]

Member Avatar for arkoenig
0
91
Member Avatar for baraah

hi how can i make program using for loops only that display the output below * * ** ** *** *** **** **** ***** ***** ***** ***** **** **** *** *** ** ** * *

Member Avatar for peter_budo
0
163
Member Avatar for BlueZephyr

I get this error: variable or field 'calc_score' declared void and I am pretty much stuck. Here is my code, it obviously isn't finished but I need to be able to get this void to compile to continue on. [CODE] #include <fstream> #include <iostream> #include <cstdlib> #include <iomanip> using namespace …

Member Avatar for packetpirate
0
239
Member Avatar for baltik08

problem: the user will input an integer for example 12345 (5 digits) and the output should be: 12345 12345 12345 12345 12345 // depending of how much digit you input or if the user will input lets say 123hi and the output should be 123hi 123hi 123hi // the program …

Member Avatar for Dhruv Gairola
0
792
Member Avatar for Lanor

Hi...I am not able to input text file correctly as desired...... data.txt -------- Jim A James A+ Smith Cathy D Dazy Peter C I am suppose to input the above file and fill the above data in two seperate arrays. For the second column, I am suppose fill NULL value …

Member Avatar for WaltP
0
97
Member Avatar for sairakhalid

i want to know whats the error over here. i just want to store the three value in a node and making a linked list but after storing two nodes that is headptr and than temptr, when the third node is made it stops. I think my error is somewhere …

Member Avatar for sairakhalid
0
174
Member Avatar for ana_1234

myint.h [CODE]#include <iostream> // so that we can overload << and >> using namespace std; class MyInt { // these overload starters are declared as friend functions friend MyInt operator+(const MyInt& f1, const MyInt& f2); //friend MyInt operator*(const MyInt& f1, const MyInt& f2); /*friend MyInt operator++(MyInt& f1, int); // postfix …

Member Avatar for ana_1234
0
395
Member Avatar for oggiemc

Hi guys, Just wondering how i would access a particular variable from an object in an array?? Consider the code: [code=c]void Animal::arrayDisplay(){ Animal ani; Animal* arry[3]; string n,c; int a; for(int i = 0; i<3; ++i){ cout <<"Input name:" <<endl ; cin>> n; cout <<"Input color:" <<endl ; cin>> c; …

Member Avatar for gerard4143
0
153

The End.