49,761 Topics

Member Avatar for
Member Avatar for alphabetanm

I understand the structure of a do while; however, when I start plugging in my statements, I am not gettng the result I want. The logic is wrong. Knowing the general form of the do while is: do statements while (condition) and wanting to write a do while code to …

Member Avatar for alphabetanm
0
94
Member Avatar for GadiK

Hi Guys, I'm trying to write a simple game of drawing rectangles and circles in a window. I've created a different class for each shape: RectClass and CircClass. Each of these classes has it own DrawShape() function which suppose to draw the shapes in the window with given coordinates argument. …

Member Avatar for Ancient Dragon
0
196
Member Avatar for odzky

Create a function w/c accepts as input the double numbers x1,x2,x3 and returns to the program the value of the average (x1+x2+x3)/3 as a variable parameter. #include<stdio.h> #include<conio.h> main() { i really dont know what next...........

Member Avatar for Ancient Dragon
0
276
Member Avatar for nparrish15

I've been working on a program and have hit a roadblock. I know conceptually what to do, but I'm having trouble implimenting it. Ok, so what it's suppose to do is take them randomly generated numbers that have been put in arrayints and factor them. This right now for an …

Member Avatar for arghasen
0
127
Member Avatar for azwraith69

i have a problem with curses my program is working properly, but when i include curses.h, it produces errors i can't understand.. [icode]classmates.erase(classmates.begin() + i);[/icode] and the error is: [COLOR="Red"]macro "erase" passed 1 arguments, but takes just 0[/COLOR] and [COLOR="Red"]statement cannot resolve address of overloaded function[/COLOR] if i remove curses.h, …

Member Avatar for azwraith69
0
194
Member Avatar for skitzo315

I need some help with Binary I/O. I know how to do it when I am specifying the filename in the code ie: [icode] fstream fio("persons.txt", ios::in | ios::out | ios::binary | ios::trunc); [/icode] What I need to know is how to open or create a file with a file …

Member Avatar for siddhant3s
0
288
Member Avatar for jeevsmyd

hey friends, here is a code that I made to find the prime numbers in an array.. What the program is supposed to do is check whether the number is PRIME or not.. The position of the element is specified and the program finds and check the element in that …

Member Avatar for jeevsmyd
0
118
Member Avatar for atman

Hello guys, I'm very green in c++ and just started to understand classes and objects. I'm reading on the web about this pointer, but having difficulties understanding how it works exactly, could aanybody please help me understand or reference a good article for total noobs in c++ to grasp the …

Member Avatar for siddhant3s
0
139
Member Avatar for halfnode

hi all pretty new to programming here the idea of the code is for the function to take in an string and an int and to pad the string with space on the left with the int being the number of space to put in. am i doing something wrong? …

Member Avatar for ArkM
1
184
Member Avatar for cassie_sanford

The problem that i am working asks to calculate a customer's monthly bill. The customer has to input their name, which package they purchased, and how many hours were used. For example package a is for 9.95 a month 10 hours of access provided. Additional hours are 2.00 per hour. …

Member Avatar for dvsConcept
1
198
Member Avatar for Himerz

Hi again people. I am stuck on this array that converts lower case letters to upper case letters. I need to find out how to make it not display strange characters after the letters are entered. I know it has something to do with the 'null' terminator, but I am …

Member Avatar for zalezog
0
138
Member Avatar for Carmen Smith

I am having trouble with the remove() function in this avl class. When I run the test below in my main my debugger tells me "there is are not enough frames in stack" pointing to the line [code]t->height = max( height( t->left ), height( t->right ) ) + 1; [/code] …

0
50
Member Avatar for minime2100

Hello, I'm currently taking a programming class in college for my first time and I am having a hard time with my assignment for the week. I have to write a program that I create a class called Student. It will then have two members within the private sector called …

Member Avatar for minime2100
0
92
Member Avatar for rafkay

Hi .. anyone can help me out to solve this problem... coding to read the file... 1. this coding is well working... can list down all the data in dataM.txt [CODE]ifstream OpenFile("D:\\dataM.txt"); int a; if(!OpenFile) { cout << "While opening a file an error is encountered" << endl; } else …

Member Avatar for vmanes
0
216
Member Avatar for rafkay

hi all, when i run this code (quick sort), i ll get ascending order as output... now i want descending order instead... anybody know how to altert this code..uhuhuh [CODE]void QuickSorting::sort(int a[], int lo, int up) { { int i, j, pivot; while ( up>lo ) { i = lo; …

Member Avatar for rafkay
0
2K
Member Avatar for Brandon515

[CODE]int write() { system("cls"); char text[2000]; char thing[100]; cout << "which file would you like to write to?"; cin.getline (thing, 100); cout << "what would you like to write? (up to two thousand characters)"; cin.getline (text, 20000); ofstream file; file.open(thing); file<<text; file.close(); system("pause"); return haha(); }[/CODE] ok so I'm writing …

Member Avatar for death_oclock
0
102
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> using namespace std; #include <iomanip> #include <cstdlib> enum RequestType { ZERO_BALANCE = 1 , CREDIT_BALANCE, DEBIT_BALANCE,END} int getRequest(); bool shouldDisplay ( int, double); void outputLine ( int, const char*const, double); int main () { ifstream inClientFile( "clients.txt", ios::in); if ( !inClientFile) { cerr << " File could not …

Member Avatar for Se7Olutionyg
0
138
Member Avatar for tones1986

hi all. in a recent project i created a linked list to store a students course data...such as course ID, year taken, semester taken, and final grade. This program worked without any problems. now, my next project is to create a stack to store the data, instead of a linked …

Member Avatar for Murtan
0
154
Member Avatar for pdwivedi

hi can anybody please expalin me that can i access the array(arr) which is declared as a private member of the class(array) by using public function (display). The code is given here... [CODE=c++]#include<iostream.h> const int size= 8; class array { int arr[size]; int i; public: array(); void display(int arr[size]); }; …

Member Avatar for Salem
0
112
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> using namespace std; #include <string> class Engine { int power; public: Engine() {power=0;}; Engine (int pIn) { power = pIn;}; void show (); float getPower () {return power;}; }; void Engine::show() { cout << " This is an engine have a power of " << power << " …

Member Avatar for iamthwee
0
137
Member Avatar for rudasi

Hello I want to write a program in c++ to convert certain rows which i can choose from a table in excel to .csv. Anyone done anything similar? I am not sure how to do this, still thinking, any suggestions.

Member Avatar for marco93
0
204
Member Avatar for C++.java

// days in a given month.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char month,january,feburary,march,april,may,june,july,august,september,october,novemb er,december; cout<< "\nEnter january,feburary,march,april,may,june,july,august,september,october,november,dec ember : "; cin>>month; switch(month) { case january: cout<< "31\n"; break; case feburary: cout<< "28\n"; …

Member Avatar for ArkM
0
109
Member Avatar for SHWOO

This function is supposed to open a file stream and copy the text into an integer array to be used for a map key. Here is the contents of the file. I am getting the decimal value stored in the array and I just cannot figure out how to correct …

Member Avatar for WaltP
0
77
Member Avatar for dvsConcept

i have this program generating 3 numbers and i don't know how to take those 3 numbers (i.e. 777) and applying that to a switch/case like... [code=c++] switch(landing) { case 'a'://777 //calculation will go here break; case 'b'://666 //calculation will go here break; ///and so on and so on! } …

0
67
Member Avatar for mushbucket

Heya, I'm trying to slim down some code by using a for loop, but the only way I can do it is by building a variable string to put in the format bit. [CODE=C++]for (n=0; n<13; n++) { strTmp.Format("%ld", pFrame->m_pAppWnd->state.Variable); strBuf.Replace(saveloadtypes[n], strTmp); }[/CODE] pFrame->m_pAppWnd->state.Variable fetches strings from another .cpp file. …

Member Avatar for mushbucket
0
200
Member Avatar for obsy

Hi! I made a visual c++ application. My problem is how do I run the program in the console. And the program should read the data from sample.txt file

Member Avatar for obsy
0
98
Member Avatar for Linking_90

Hi, I was hoping that someone could give me some direction with how to solve this probem. The only info in this problem is word has N digits[only digits] and each digit in the word is in increasing order example 1469 or 362 I have to verify if the number …

Member Avatar for Linking_90
0
142
Member Avatar for nitu_thakkar

hello everone i'm new to c++ language Is This possible to make prg in cpp to overload () Opratore if yes, then can u pls give any logical flow for develope the prg i.e. which kind of opeartion can be performed through () opratore thanx in advance

Member Avatar for Narue
0
80
Member Avatar for jaison.steephen

how to add graphics library to Turboc++5.0 so as to run functions like circle(x,y,r); I am using XP sevice pack2. Plz help me. thanks in advance

Member Avatar for daviddoria
0
50
Member Avatar for Emerald214

I get the size of the integer array by using sizeof operator but the problem is: + Outside class: It outputs 3 (correct) + Inside class: It outputs 1 (incorrect) So how to fix it? Thanks [CODE]class A { public: A(const int a[]); }; A::A(const int a[]) { cout << …

Member Avatar for Emerald214
0
145

The End.