49,761 Topics
| |
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 … | |
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 … | |
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() … | |
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 … | |
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 … | |
Can anybody tell me the diff between keywords and identifiers? Cin and cout in C++ are keywords or identifiers? | |
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 … | |
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, … | |
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 … | |
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 - … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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++. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
How do I nest a while loop inside a do..loop without using if statement? | |
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 … | |
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 … | |
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 … | |
anyone know how what is UInt in C++ mean to VB. I mean how to write in VB.net | |
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 … |
The End.