49,761 Topics

Member Avatar for
Member Avatar for GregPeters

Hi all. I have recently been learning C++ and have gained a moderate understanding of how things work. Texts files seem to confuse me though so i was wondering if someone could help me out. :) Basically I have a text file which looks something like: [CODE]** <Question> What is …

Member Avatar for csurfer
0
241
Member Avatar for slychronic

Gooday i have a question to make a program using the connect function and all i hve done is below. how do i complete the the first loop and the second loop...on what i should do next here is my code so far, explaination will be appreciated....[CODE] #include <iostream> using …

Member Avatar for mike_2000_17
0
160
Member Avatar for jalenamichelle

what is wrong with this? i keep getting an error that says error C2059: syntax error : 'if' && error C2059: syntax error : 'else' [code] int main (void); void menu(void); int getChoice(void); int *year, *day, *month, julianday; int dayspermonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, …

Member Avatar for WaltP
0
95
Member Avatar for dwhite459

I am trying to write a program that allows the user to input positive integers between 0 and 1000 and then outputs the highest value and the lowest value. The user should enter -1 to signify the end of their input. I am supposed to use a loop to achieve …

Member Avatar for WaltP
0
6K
Member Avatar for sharifyboy7

For my program I am supposed to implement an encryption and decryption algorithm. I then have to print it out using my functions I have to read the input from a file, “plaintext.txt” The file will contain plaintext strings that are all lowercase, and be of the format: 3 hello …

Member Avatar for hag++
0
261
Member Avatar for aznlitomik3

MY ASSIGNMENT: Write a program that works with fractions. Your program should be able to add, subtract, multiply, and divide two fractions. Specifically, your program must request two fractions from the user, getting the numerator and denominator separately for each fraction, and the operation to perform (add, subtract, multiply, or …

Member Avatar for aznlitomik3
0
13K
Member Avatar for Lance5057

Whenever I run this code the while(b<63) only seems to run once then does nothing. The (a<63) loop runs fine but doesn't go again because the first loop just stops. Any idea what's going on? [CODE]#include <iostream> #include <time.h> using namespace std; int main() { int a,b,c,sand; int land[64][64]; srand((unsigned)time(NULL)); …

Member Avatar for Lance5057
0
106
Member Avatar for travigne

This is the question : you are burning some music CDs for a party. You've arranged a list of songs in the order in which you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. So, …

Member Avatar for travigne
0
2K
Member Avatar for ahaykal

I have this homework in which I have been working on it: but I dont know what im doing wrong :( Could anyone help me: [code]#include <iostream> #include <cstring> using namespace std; class Account { private: char number[8]; char type; char owner[31]; double balance; double interestRate; public: Account() { number[0] …

Member Avatar for ahaykal
0
243
Member Avatar for vbx_wx

[code] class Security { public: virtual ~Security() {} }; class Stock: public Security {}; class Bond: public Security {}; class Investment: public Security { public: void special() { cout << "Special Investment function" << endl; } }; class Metal: public Investment {}; int main() { Security* s = new Metal; …

Member Avatar for vijayan121
0
103
Member Avatar for ayesha91

Hello, I am having a problem with an assignment that I have to submit tomorrow which is to let a user construct an object. in the assignment it is asked from me to create a DVDshop class where the user can create a DVD object. Also, in this class I …

Member Avatar for ayesha91
0
119
Member Avatar for angel6969

Write a program that will read in a sentence of up to 100 characters and output the sentence with spacing corrected and with letters corrected for capitalization. In other words, int the output sentence all strings of two or more blanks should be compressed to a single blank. The sentence …

Member Avatar for cbsinc
0
2K
Member Avatar for kuchick32

I'm trying to use a getline function in my program. I have the correct cout function but when I try and enter my input the program keeps wanting me to enter a couple of times and then that's what comes out. I'm very confused on what I'm doing wrong in …

Member Avatar for kuchick32
0
109
Member Avatar for bpress91

I have written a program that allows for two people to play tictactoe, however it will not work. I am not sure what the problem is. Can some please help? Thank you in advance

Member Avatar for technologic
0
39
Member Avatar for akssps011

Hi I wanted to start a project on implementing packet sniffer. Though I have fairly good experience of C++ programming and network protocols( theoretical), I am not able to get start with this. How should I approach towards it. What libraries or resources should be helpful ? Would Qt be …

Member Avatar for alwaysLearning0
0
109
Member Avatar for naricpp

Hi All, Please find the below code and please elaborate how derived class default copy constructor is calling base class copy constructor which is implemented by the base class. [CODE]class X { X( const X& x ); } class Y ; public X { } class Z { void fun( …

Member Avatar for Fbody
0
147
Member Avatar for MAPONYA

I'm a beginner as far as c++ is concernt.I want help using user defind funtions

Member Avatar for rahul10.rawat
-1
144
Member Avatar for BryantFury

hello, so im designing a simple prgram which calculates the cost of a ticket you buy. there are only 3 ticket options, namely a b and c. here is my code. [CODE] #include <iostream> using namespace std; const int PRICE = 3; int find(int [PRICE]); int main() { int nums[PRICE] …

Member Avatar for Tom83B
0
104
Member Avatar for mommabear

[B]Specifications (minimum):[/B] The CDROM class contains the following, private, data members: string Name; // The Name of the CDROM string CDType; // The Type of CDROM float Cost; // The Cost of the CDROM [I]The ONLY recognized (i.e., legal) CDROM types are, “Game”, “Word”, “Compiler”, “Spreadsheet”, “Dbase”, and “Presentation” (AND, …

Member Avatar for mitrmkar
0
148
Member Avatar for format_c

Im trying to create an object array that accepts values generated by a 2 random functions so that i can sort the objects in the array based on one value of an identifier (finishtime) in each object. eg. twenty Activitys with datamembers [starttime, finishtime, id] my code for the main.cpp …

Member Avatar for thelamb
0
189
Member Avatar for digan

Hi, ive only started programming recently and as my second assignment i have to write a program that can convert uppercase letters to lowercase letters and visa-versa. i also have to make it stop when a full-stop is entered and count the number of times the program changed letter case. …

Member Avatar for digan
0
107
Member Avatar for bejfake

Hi, I've got such class template: [CODE=c]template <class Type> class Stack{ private: struct Element{ Type value; Element *prev; } *end; public: Stack(){ end = NULL; } void push(Type value){ struct Element *element = new Element; element->value = value; element->prev = end; end = element; } Type pop(){ if(end != NULL){ …

Member Avatar for alwaysLearning0
0
3K
Member Avatar for fantasma

Greetings from Portugal to everyone. I'm building a project to a course in my university and i've stucked in some compiling error given by NetBeans and g++ in my dynamic array implementation. Glad if someone could give a hand to this. Here is the code [ICODE]#pragma once #include <iostream> #include …

Member Avatar for fantasma
0
121
Member Avatar for Nathaniel10

This is a follow-up exercise to the one related to reference and dereference operators. Stroustrup asks the reader to modify that program to handle an array overflow. He wants us to specifically use the realloc() function. I read the tutorial here but didn't understand the example. I read other web …

Member Avatar for Ancient Dragon
0
98
Member Avatar for jimbob90

Here's my main [code=c++] int main () { int list1[3] = {5,5,6}; int num = 3; int result; int *arr = list1; int maxVar; int *maxVarHolder; maxVarHolder = &maxVar; result = sumarr(*arr, num, *maxVarHolder); return 0; } [/code] Here's the function header: [code=c++] int sumarr (int *arr, int size, int …

Member Avatar for mike_2000_17
0
229
Member Avatar for Lightslei

I need the program to read 2 pieces of data from each line of a text. For example my txt is: [code] A Garbage B Garbage2 A Garbage3 A Garbage4 A Garbage5 B Garbage3 B Garbage [/code] Now IIRC the getline function breaks after the first space. The program is …

Member Avatar for WaltP
0
121
Member Avatar for format_c

Im trying to write a code for a class that has 20 activities .. each activity has a start time and a finish time. When i try to generate the times the start time is larger than the finish in some cases. can any one help me with my function …

Member Avatar for jonsca
0
146
Member Avatar for arithehun

Anyone that develops GUI applications in C++ will definitely be familiar with the C++ <windows.h> class. However, I am wondering who wrote this vast class?

Member Avatar for Ancient Dragon
0
98
Member Avatar for Greywolf333

Hey all, I need to initialize an array to hold an image to all zeroes. The dimensions are that of an image [numcols][numrows][3], where 3 is for rgb values. I know this isn't necessary when I'm reading an image into the array, of course, but I'm going to be using …

Member Avatar for Greywolf333
0
129
Member Avatar for 0dark

Hello guys, this is my first post, so don't be harsh if I do something stupid. Well, the reason why I'm posting here is because I need to find a method to alter the stream itself, not just the buffer I send to a variable with "file.Read(". For example, lets …

Member Avatar for Ancient Dragon
0
228

The End.