49,757 Topics

Member Avatar for
Member Avatar for doolali

Hey guys, ive just started learnng c++ after a year or so of java, one issue that has just cropped up for me is repeating input from console. if for example i ask for an input, expecting just 1, and the user inputs 2 with a space inbetween how do …

Member Avatar for doolali
0
538
Member Avatar for nubore

[code] void Sort() { int Holder, k = 0; srand( time(0) ); // seed random number generator while ( k < HowMany ) { Holder = rand(); // generate random number to Holder if ( Holder > 10 && Holder < 100 ) { Numbers[k] = Holder; k++; } } …

Member Avatar for tenorsax08
0
107
Member Avatar for bmos31

So I have an assignment to redefine an array-based Stack push() function. The problem itself sounds like it totally defeats the purpose of a stack, but this is what I have been assigned: Rewrite the push function so 'myTop' is always 0 instead of one more than the index of …

Member Avatar for Fbody
0
150
Member Avatar for cableguy31

I need to write code that can determine if an IP address is in a subnet based one the subnet address and mask. I don't even know where to begin with this, so any tips would be appreciated. Thanks.

Member Avatar for cableguy31
0
1K
Member Avatar for ButterFly21

#include "p2.h" #include <iomanip> #include <string> using namespace std; /* * Converts an amount measured in cups to milliliters. * 1 cup = 236.518538 milliliter * * cups - amount measured in cups * * returns amount in milliliters */ double convertCupstoMilliliter(double cups) { //modify -1 below to be your …

0
52
Member Avatar for ButterFly21

I have given instructions to write some code and i have to follow the comments giving and i get stuck and some point so can anyone tell me what i did wrong /* * Returns the percent change from the original to the desired servings. * The percent is expressed …

Member Avatar for ButterFly21
0
80
Member Avatar for kanna5836

Project Makcik Minah has opened a new children art class. During the Registration Day, 30 children have registered. Makcik Minah’s assistant, Munah has manually obtained information from the children that include name, birth certification number, date of birth and gender. All these information is required in order to divide the …

Member Avatar for packetpirate
0
173
Member Avatar for miturian

So, in the course of a simulation of a neural network I have two classes: neurons and synapses (which are basically the coupling between neurons). Synapses mediate information between neurons, so a neuron has to be able to speak to a synapse, and that synapse has to be able to …

Member Avatar for Fbody
0
120
Member Avatar for ButterFly21

Why a i getting this message after i compile my program c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\..\..\..\libmingw32.a(main.o):main.c|| undefined reference to `WinMain@16'| [CODE]/* * p2.cpp * * Created on: Oct 7, 2010 * Author: saturner */ #include "p2.h" #include <iomanip> #include <string> using namespace std; int main (); /* * Converts an amount measured …

Member Avatar for Nick Evan
0
138
Member Avatar for fidget08

Im having trouble with this program. I attached a picture of what is required. Thanks for any pointers you guys :) p.s. I'm very new to this.

Member Avatar for quila1
0
123
Member Avatar for Dimesh

Hi. ----- Thanks for reading ... I want to write for example: ln 3 Is there is any command or function for it ...!

Member Avatar for sharathg.satya
0
4K
Member Avatar for IS_student

[COLOR="Green"]hi; i am doing a homework(due tomorrow) and i have a problem with it; when I compile the program it shows no errors, and it takes input ,but does not show the output using function print(); note :the function of the program is to take elements from user,stores them in …

Member Avatar for IS_student
0
111
Member Avatar for mrinal.s2008

Hi, the code analysis tool we use gives below warning for the functions in which memset / memcpy is used "The function writes outside the bounds of dup on line 303, which could corrupt data, cause the program to crash, or lead to the execution of malicious code." could someone …

Member Avatar for Fbody
0
219
Member Avatar for Intrade

What I want to know is if I can call a function defined in a C++ class in Visual Basic through a .dll generated from VC++2010? Is this possible, or do I need to define the .dll with C++ raw functions outside of a class? For example, my class looks …

Member Avatar for Ancient Dragon
0
259
Member Avatar for Anuradha Mandal

The output of this code shows only one student's informations. But I want to display the all students' informations. Please find what is wrong?

Member Avatar for vidit_X
0
87
Member Avatar for vbgrad

I need to use arrays, insertion sort algorthm to come up with a program tht will sort 3 employees salaries in an ascending order after user has inputed data..thus EMPLOYEE1:20000 EMPLOYEE2:15000 EMPLOYEE3:10000 CAN SOMEONE HELP WITHE THE FUNCTION TO MAKE MY PROGRAM DO THAT PLEASE!

Member Avatar for stevanity
0
171
Member Avatar for Dha...1

I'm planning to buy a few books for C++. I want to learn C++ at it's deepest. You may say, I want to be C++ program developer. I'm currently having C++ in my study courses too. Which are recommended books? This thread has a huge list of books. Don't think …

Member Avatar for rsravi74
0
152
Member Avatar for jmcorpse

This is what I have to do. Write a program that has a Fibonacci number calculating function. The function will take an integer as a parameter which is the Fibonacci number to calculate, and return the Fibonacci number. Then use this function to calculate the sum of every Fibonacci number …

Member Avatar for jmcorpse
0
100
Member Avatar for a-hall

I need to put the names entered by the user in alphabetical order. What are my variables to declare? Im wanting to use something like this in my code but do not know what my array is or anything. selection_sort(arr1, arrSize); [CODE]using namespace std; int main () { string temp; …

Member Avatar for stevanity
0
127
Member Avatar for geekykitty

This is the output: Amount: 69.73 Dollars: 69 Quarters: 2 Dimes: 2 Nickels: 0 Pennies: 3 this is NOT ONLY for 69.73. It's any amount in general. I know how to figure out the amount of dollars needed. But how would you figure out how many quarters, dimes, nickels, and …

Member Avatar for PatrixCR
0
64
Member Avatar for BryantFury

so im calculating the avergae of 5 numbers ive put in the array but when i compile i get a very large number heres my code [CODE]#include <iostream> using namespace std; int calcAverage() { int sum=0; int average; int TESTVALS[5] = {2, 18, 1, 27, 16}; for(int i = 1; …

Member Avatar for BryantFury
0
112
Member Avatar for sonjeriff

Hi! I'm new this semester to C++ and it is a little difficult for me. Our class has a project where we need to implement functions. While I got the very first one right, I'm not sure what to do about the others that are similar to it. Can anyone …

Member Avatar for cmccaig
0
185
Member Avatar for FieryAbyss

This is the assignment: Purpose: The purpose of this assignment is for you to demonstrate your ability to design and code a program that employs a multi-decision construct such as else...if, or switch to resolve a problem that has a multiplicity of conditions to be evaluated. Use the else...if for …

Member Avatar for kes166
0
166
Member Avatar for geekykitty

I know how to get it, basically. It's just for my program, it's 362 minutes. That is 6:02. The thing is it's ZERO two. I don't know how to get the zero and then the two?

Member Avatar for Unimportant
0
94
Member Avatar for cmccaig

i know the minimal basics of a lambda function, could someone give me the breakdown of each part in the function

Member Avatar for cmccaig
0
95
Member Avatar for mchin131

I have this assignment where I'm supposed to read in a text file and assign the values to a vector and sort them out. The text file has values for country, population, birth rate, and death rate. An example is: (not realistic numbers) USA 400000 5400 3200 Canada 56000 3400 …

Member Avatar for gerard4143
0
65
Member Avatar for ana_1234

I have a problem I'm not sure where the error is occurring. I think it's when I used cin.ignore in my code. My problem is occurring in case A. For some reason the program stops right after I enter my price information. I tried doing small codes to figure where …

Member Avatar for Greywolf333
0
168
Member Avatar for cosnersx

There is a sample program in my C++ book that uses the += operator, and doesn't explain how it works: [CODE]gold += silver / SILVERPERGOLD;[/CODE] What exactly does this mean?

Member Avatar for Greywolf333
0
70
Member Avatar for xiansen

Hi guys, below is what i have so far and I am having trouble outputting the players' data in descending order. For some reason, my output is in ascending order. Also, I need to check if the user enters a player number that has already been used, and then prompt …

0
76
Member Avatar for rpdm

How can this BST class be better? [code] #include <iostream> #include <iomanip> #include <stdlib.h> #include <time.h> #include <conio.h> using namespace std; template <class KeyType, class ValueType> class BST { public: BST(): mroot(0), mcount(0) {} BST(BST const& tree) { *this = clone(tree.mroot); } BST& operator=(BST const& tree) { if (this != …

Member Avatar for alwaysLearning0
-1
111

The End.