49,757 Topics

Member Avatar for
Member Avatar for dolfan55aj

I'm a new member and this is my first post, so be gentle ;) It's been a while since I've gotten a chance to practice with recursion so to say I'm a bit rusty is an understatement. Not to mention I've never implemented it with a linked list. My current …

Member Avatar for mike_2000_17
0
521
Member Avatar for existinglady

This is our new and revised program... for the registration: I thank all of those people who helped me. for the search function: so I've manage to, actually my teammate managed to get a search function working for edit function: we havent figured it out on what methods are gonna …

Member Avatar for existinglady
0
2K
Member Avatar for monkeybut

IT currently is set up for base 3, but should be able to make a couple of minor changes and convert to any base, thanks and hope it helps someone out. [code]#include <iostream> #include <cmath> #include <fstream> using namespace std; void convert_base(int v, int b); ifstream inputdata; ofstream outputdata; int …

Member Avatar for mike_2000_17
1
529
Member Avatar for guccimane

I wrote a program that opens a file using the command line (cmd), calculates a bunch of numbers, then outputs the results to another file. The program works fine, but when I tried to alter my code using classes, all of a sudden the program is not fine. Here is …

Member Avatar for guccimane
0
939
Member Avatar for SquigsSquigley

Hi all. I know that others have posted about Rock Paper Scissors, but none of their posts are exactly what I am needing. My issue is that for my program, we are required to use at least 1 switch and 1 if statement, as well as keep track of the …

Member Avatar for raptr_dflo
0
990
Member Avatar for dooper

here is my code: [code]#include <fstream> #include <iostream> #include <string> #include <fstream> #include <string> using namespace std; void displayjulianDates(int, int, int, int, int, int); int main() { //Declare variables int month1; int day1; int year1; int month2; int day2; int year2; //Gets input from user cout << "Please enter the …

Member Avatar for Masterlynx
0
306
Member Avatar for valestrom

I have a function, kinda like a main menu. But no matter what it always picks the first statement, even if it doesn't match the parameters of it's if statement, so it nevers get to the exit game function. So I can't use my close game function, and I would …

Member Avatar for valestrom
0
2K
Member Avatar for ntrncx

how i can pass inside a vector an array? i know how to do it without classes but i don't know how to do it with constructor. i try to create a 2nd constructor that takes array of integers and the size of array and initialize a vector. header [CODE]#ifndef …

Member Avatar for ntrncx
0
143
Member Avatar for alle

I am converting a program written using Borland Turbo C to M$ Visual C++ 2010. I have created a Win32 application, and have now managed to write to a window. But the font that has come out is a proportional one, and I need a fixed font for everything to …

Member Avatar for amyuni
0
542
Member Avatar for PaulProgramer

Hello, I have a problem with my program that I can´t figure out. I would appreciate if someone could give me some hints on what to do. I am trying to write a program that checks how many random numbers less than a positive integer N one should generate before …

Member Avatar for PaulProgramer
0
219
Member Avatar for efigen

I have an input file that i make into a string, it looks like this "1+2+3+45*5*2" My problem is when i print the string it always prints as single characters instead of 45 i get 4 5, how do i fix this. heres a small piece of the code. [CODE] …

Member Avatar for WaltP
0
99
Member Avatar for Khan Shaeen

Hie....M new to this site... i have to do a project on c++ using arrays, plz suggest me some topics if u can, so please can u help me asap...

Member Avatar for L7Sqr
-1
27
Member Avatar for monkeybut

I am having trouble figuring out how to convert base 10 to base 3, I have tried several different attempts and this is my latest effort, anyone have any ideas. I was giving this algorithm but am having trouble creating a function for it: [B] 1. Set k to the …

Member Avatar for monkeybut
0
4K
Member Avatar for ccoder83

Hi, I'm trying to create a 2D grid that would allow me to use fluid properties in each cell of the grid, which is defined by a struct. I have 3 grids: [CODE=c]Grid2D <fluidProperties> grid1; Grid2D <fluidProperties> grid2; Grid2D < fluidProperties> grid3;[/CODE] My struct fluidProperties contains 12 different properties: [ICODE]struct …

Member Avatar for ccoder83
0
203
Member Avatar for Demetrio.pepi

I am trying to compile this example [url]http://www.boost.org/doc/libs/1_42_0/doc/html/boost_propertytree/tutorial.html[/url] and I am getting the error "/usr/local/boost_1_47_0/boost/property_tree/detail/ptree_implementation.hpp:795:54: error: request for member ‘put_value’ in ‘tr’, which is of non-class type ‘bool’" in this line: BOOST_FOREACH(const std::string &name, m_modules){ pt.put("debug.modules.module", name, true); } My full error message is: make all Building file: ../src/Boost_property_tree.cpp Invoking: …

Member Avatar for Demetrio.pepi
0
389
Member Avatar for HelpStudents

If I have a vector of structs [CODE] struct widgets { string widgetName; int age; int color; }; [/CODE] and widgetName had multiple words in lets say widget one type 45 blue widget two 34 yellow widget eight 46 green widget ten type 33 pink and I wanted to search …

Member Avatar for arunp_eagle
0
146
Member Avatar for aspirewire

I'm testing to see if the sides make up a right triangle (a^2 + b^2 = c^2), but how do I make it so that, no matter the order put in, "c" will always be the largest of the three?

Member Avatar for raptr_dflo
0
216
Member Avatar for HelpStudents

I am running into an issue trying to use an iterator to print. I am trying to print the widget name and widget type from a class and am getting an error on the iterator part. The rest of the code works fine but any comments on that are more …

Member Avatar for tajendra
0
112
Member Avatar for DalekThay

I am having problems with understanding this code. The program should write all permutations of first N numbers. [CODE=c] #include <stdio.h> #include <iostream> using namespace std; void print(const int *v, const int size) { if (v != 0) { for (int i = 0; i < size; i++) { printf("%4d", …

Member Avatar for raptr_dflo
0
81
Member Avatar for Steven_gerrard

Hey guys, I am posting here for the first time, so please be gentle with me :P. I have an assignment of storing a text file in two arrays (one contains both char and int, whereas the other contains just numbers. The text file looks something like this: Time 2 …

Member Avatar for raptr_dflo
0
160
Member Avatar for guccimane

Hi, I am trying to read an input text file. And read the last letter only and check if it is an '+' or '*'. Here is the code I have written so far, if anyone can help me, I would be very greatful. [CODE] while(input>>lastChar) //put file contents into …

Member Avatar for WaltP
0
99
Member Avatar for iAMyours

[CODE]// initial_project.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> using namespace std; void printmessage() { cout <<" ***WELCOME TO THE ALLOY INQUIRY PROGRAM!*** " <<endl; cout << endl; cout<< "Please Choose the Number of Your corresponding Choice\n \n (1) Aluminum Alloys \t \t (11) …

Member Avatar for raptr_dflo
0
179
Member Avatar for Jared1337

I'm having trouble getting this program to work for roman numeral conversion. I hope it says that i have one error, which is C2110: cannot add two pointers. here's what i have so far... ANY help would be great, thanks a bunch! :) [CODE]#include <iostream> using namespace std; int main() …

Member Avatar for raptr_dflo
0
4K
Member Avatar for jper

so im basically new at c++. i need to generate 20 entries randomly from 1-20, and each number must be unique. i was able to generate the number but i don't know how to make them unique. any suggestions?[CODE]#include <iostream> #include <stdlib.h> #include <time.h> #include <math.h> using namespace std; int …

Member Avatar for jper
0
445
Member Avatar for aspirewire

I want it to say "You are correct!" when the number they guess matches the random roll but it just keeps saying this when I type in 6 as my guess, how do I fix it? This is what I wrote in the main: [CODE] int num; int die; cout …

Member Avatar for WaltP
0
128
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
156
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

The End.