49,761 Topics

Member Avatar for
Member Avatar for mullerfourie

Hi, I need to finish a assignment on operator overloading but this one piece of code doesnt seem to make sense.. in my int main() i have int main() { Element a, b(5), c(7), d; cout << (5+b) << endl; this is just part of it, I have already implemented …

Member Avatar for mullerfourie
0
212
Member Avatar for NathanOliver

Hey all, I was taking a look at my stringstream conversion function and I couldn't decide how I want to handle a bad conversions. I used an exception and then in main I would a use a try, catch block to get any exception. [code=c++] #include <sstream> #include <exception> class …

Member Avatar for mike_2000_17
0
158
Member Avatar for lynn21

This is the program that I have written, my problem is that the contents in the for loop does not execute. When I compile I get enter number of students to be registered And total cost of discount is R 0 QUESTION 2 PROGRAM #include <iostream>using namespace std; int main() …

Member Avatar for lynn21
0
113
Member Avatar for SoulReaper1680

Hey, when I run the following code: [CODE]for(double i = 3; i >= 0; i -= 0.2) { cout << i << " "; }[/CODE] I get the output "3 2.8 2.6 2.4 2.2 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2". For some reason, it doesn't output …

0
86
Member Avatar for Epicurus

I've created a new class called BulletList2(linked list) using the built in dialog(File>New Class) which created a header file called bulletlist.h (in project folder>include) and a source file called bulletlist2.cpp(in project folder > src). header file [CODE=c++]#ifndef BULLETLIST2_H #define BULLETLIST2_H class BulletList2 { [...] } #endif // BULLETLIST2_H [/CODE] In …

Member Avatar for Epicurus
0
3K
Member Avatar for himanjim

Can anybody tell me the diff between keywords and identifiers? Cin and cout in C++ are keywords or identifiers?

Member Avatar for Ancient Dragon
0
153
Member Avatar for cent91

0 down vote favorite share [fb] share [tw] share [in] i am working on a tiny tiny app that just uploads a file to the ftp server, i have reviewed my code but am quite unable to locate the problem, here is the code, [CODE=C]#include "stdafx.h" using namespace System; #include …

Member Avatar for Moschops
0
2K
Member Avatar for guccimane

Hello, basically I want to read an input .txt file, and check to see if '+' or '*' is at the beginning or end of the file. The file can have a space at the beginning, and that should be ok. This is the code that I think should work, …

Member Avatar for vijayan121
0
258
Member Avatar for zxcvbnm,.

Okay, so I have tried to write a program that would generate the rule of 110. quoted from wikipedia: The Rule 110 cellular automaton (often simply Rule 110) is an elementary cellular automaton with the following rule table: current pattern 111 110 101 100 011 010 001 000 new state …

Member Avatar for raptr_dflo
0
565
Member Avatar for SCass2010

Hi everyone, I was wondering if anyone could help me - at the minute I have a c++ program that renames a file and then attempts to move it too a new folder using linux commands and passing them to the 'system()' function. It renames the files no problem - …

Member Avatar for SCass2010
0
212
Member Avatar for nasgaillean

Ok, I've been trying to research this, but have had no real luck for my level of understanding. I've been programming C++ for a while and have decided to learn DB programming (just because I want to). Anyhoo, I am unable to figure this one out: I have a simple …

Member Avatar for raptr_dflo
0
205
Member Avatar for jh3lps

Hi all, I'm having problems writing to a file, and can't figure out what's happening. Basically I have a program which tracks movement over several timeunits (each timeunit takes several timesteps). At each timeunit I write the results to a .txt file. However my program keeps crashing on the last …

Member Avatar for raptr_dflo
0
772
Member Avatar for Johnny666

Im trying to make a game. Theres a player and he shoots bullets, and i was told whats wrong is it is making a shallow copy instead of a deep copy even though i researched this i cannot completely understand it. This is my attempt however i know it is …

Member Avatar for raptr_dflo
0
182
Member Avatar for logan_231_2009

good evening guys. I have a problem with my -simple- application. I have 2 forms (Form1 - Form2), i create an object in Form1 (Person type) and i want to get the values of data members when i focused to the Form2 and i press getPerson button. But how can …

Member Avatar for raptr_dflo
0
109
Member Avatar for TheNNS

I have a 2D array with generated doubles. I need to write this array to a CSV file so that I can open it in Excel. Is there a method or function in C++ that allows for this to be done? I could do it manually, but it would take …

Member Avatar for TheNNS
0
3K
Member Avatar for ameen_al

Guys, I’m trying to integrate libssh2 libraries(windows version libssh2-1.2.5) with Dev-C++( v4.9.9.2). The OS is Windows XP SP3. I’m facing the following error when I compile the test file ssh2_exec.c (built in example) file. Compiler Output: --------------------- [Linker error] undefined reference to `libssh2_session_block_directions' [Linker error] undefined reference to `select@20' [Linker …

Member Avatar for rubberman
0
997
Member Avatar for Shermanofcby

My professor in his grading robot decided to put a unicode character in a ciphering program and my code really doesnt like it at all. Can anyone help me without using loops? [CODE]// //Caesars Cipher //program encrypts a file using caesars cipher //Due 9/9/11 //created 9/9/11 //last modified 9/9/11 #include …

Member Avatar for raptr_dflo
0
123
Member Avatar for aero31aero

I want to create a program in which the output currently on screen is stored in the file and when required, can be read and printed on the screen as it is. I want to use it to create a program in turbo c++.

Member Avatar for raptr_dflo
0
390
Member Avatar for owenransen

I get a warning about recursion when I compile the code below. I think the warning is wrong. Here is the background. I have two functions which "add a layer" to a DXF file. They have the same names but different parameters. One of them takes a CString and one …

Member Avatar for owenransen
0
283
Member Avatar for owenransen

As far as normal ascii is concerned can I compare a wchar_t with a char type to see if they are equal? I think, but do not know, that the most common ASCII chars have the same integer value in char and wchar_t. Is that true? Do I need to …

Member Avatar for owenransen
0
3K
Member Avatar for Vusumuzi

void FUNCTIONS WITH DIFFERENT TYPES AND NUMBERS OF PARAMETERS Ms Smart, a lecturer at a famous university, wants to compare the results of male and female students. She decides to calculate four averages, namely the average year mark for male students, the average year mark for female students, the average …

Member Avatar for raptr_dflo
0
252
Member Avatar for Vusumuzi

The code runs but the problem is that the the discount value is not calculated wrong. Which part did I miss here. Here is the question: You now have to add a function discFee that has three value parameters - two of type int representing the number of sport and …

Member Avatar for raptr_dflo
0
125
Member Avatar for Vusumuzi

I'm trying to get this to execute my main function but for the life of me, I can't seem to let is do that. there are no errors when running the code. What it is suppose to do is to prompt a user for gender between m for male and …

Member Avatar for Vusumuzi
0
300
Member Avatar for Vusumuzi

I decided to give this a go again today. The pupils of the Annandale High School have to pay a fee for each extramural activity that they want to partake in. These activities include sport, and other activities such as chess, ballet, etc. The fee for sport activities is R120 …

Member Avatar for raptr_dflo
0
134
Member Avatar for Vusumuzi

How do I nest a while loop inside a do..loop without using if statement?

Member Avatar for Vusumuzi
0
110
Member Avatar for C_Hickman

im making a C++ web browser, i have the basic design all i want now is it to be an anonymous browser, similar to a proxy site. is there a code you can give my to do this. im doing this for a friend who likes to play games in …

Member Avatar for pseudorandom21
0
294
Member Avatar for oscargrower11

I'm working my way through Accelerated C++ and I've come across this exercise. The read_hw function works fine if it's void as long as I comment out the "return in" line. The author didn't bother to explain why he's returning a reference to the cin that was passed in the …

Member Avatar for oscargrower11
0
204
Member Avatar for Celcion

Hello again. I have another conundrum on my hands. At the moment I am trying to program a simple flowchart of an ordering system of sorts. At one part, the program will ask the user for his/her name, then continue on. Later on, the user will place an order, and …

Member Avatar for Greywolf333
0
113
Member Avatar for april_er
Member Avatar for thatscrap12543
-1
395
Member Avatar for hondros

Alright , so I spent _forever_ trying to figure this out. So, if any newbies here need to know how to write and read ANY object (with the exclusion of pointers, but I'll get to that), this is something that can help. First and foremost, you have to take endianness …

Member Avatar for mike_2000_17
0
366

The End.