Beginners - March 2016 (Page 3)

Run-time error when allocating new char[]
 
Hi people, the code below describes an example of implementation for couple functions of built-in C++ string class, as the CTOR and insert() . when I run thi...
[10 replies] Last: Alright, thank you guys (by leonid1990)
Loop Question
 
This program calculates average miles per gallon. Calculates average gas price and calculates the cost for a car to go one mile. Everything is executing just fi...
[5 replies] Last: Lines 21-26: Your editing doesn't seem right. Line 18, you're checki... (by AbstractionAnon)
Class and string question
 
Hi everyone, I recently got an assignment that requires me to use a class and strings to make a program about a movie. The exact question is... "Define a c...
[5 replies] Last: Here is how to copy a C++ string. string original("beans"); string c... (by Moschops)
by kell
compiling errors
 
Hello, I'm new to running programs in the command line. I need to run the c++ program at this github: https://github.com/moneroexamples/mymonero-simplewallet ...
[6 replies] Last: The error message says: /home/a/mymonero-simplewallet/src/monero_hea... (by MikeyBoy)
Variable sized arrays without using vector !
 
//https://www.hackerrank.com/challenges/variable-sized-arrays //original challenge //How should I avoid memory leak ,just delete the pointers declared by new ke...
[11 replies] Last: #include <iostream> using namespace std; int main() { void do_wo... (by ne555)
'std::out_of_range'
 
I'm sure I didn't do anything wrong here... vector< vector< vector<int> > > M; if(database.is_open()){ int user, item, time, result; while(getline(...
[4 replies] Last: if(M.size()<user){ should be: if(M.size()<=user){ because i... (by cire)
by Enot02
The randomize()
 
Randomize() should randomize random(x) function. But it doesn't in the following code. Without randomize() the program gives the same every time you execute...
[1 reply] : One problem is that you access memory you don't own. bool a ; while(... (by Thomas1965)
Reading in spaces.
 
Below isn't the full code but it is where my problem is. I am trying to read in an input file, remove the vowels, and then output it. I am running into the prob...
[2 replies] Last: Ignore the last function. #include <iostream> #include <cstdlib> #i... (by tomtom61695)
Euler's number loop
 
I am trying to find Euler's Number to an accuracy inputted by the user in the form of (.001, .00001.....) i believe my error is with the math and the start poi...
[3 replies] Last: Yes, but multiple postings are ultimately a time waster for those who ... (by TheIdeasMan)
Euler's Number Loop
 
I have to find euler's number to whatever the user's desired accuracy is (.001,.0001....) i cant figure out why my code is returning inf as the answer for every...
[9 replies] Last: Hi, Using your previous code, some poor man's debugging: do { e... (by TheIdeasMan)
pointer object to str() does not return data
 
my problem occurs in : cout << p1->str(); line 68 I need information from the student account to be displayed after being inserted into the tmp_variables i...
[2 replies] Last: I made the str() a pure virtual by making it = 0. so I should add a b... (by PopRockCandy)
Simulations
 
Writing a program and I need help. should I be using for loops, while loops? Am I on the right track? Here is the problem: Exercise One: Simulation Prog...
[8 replies] Last: Sorry Im a bit confused. Do you need help finding a way to count the a... (by McNo)
by suppa
comparison between Array and Map
 
I am doing a code force problem link: http://codeforces.com/problemset/problem/600/B #include <bits/stdc++.h> using namespace std; typedef map<int,int>::ite...
[1 reply] : If some value is entered 100 times and you only increase total once ... (by cire)
by sohdas
Random Words
 
Hello I'm a high school student, currently learning c++. I want to know if it's possible for me to access an online database (dictionary, etc.) that has many wo...
[1 reply] : > online database (dictionary, etc.) that has many words I can draw f... (by JLBorges)
Help with Sorting Array Code
 
Hello wonderful people, can someone please help me with my code? I am suppose to have the user enter the number of elements in an array and then have the user e...
[2 replies] Last: Thank you very much for your help! (by Supershock01)
Write a program to output the sum and single digits of any integer
 
I'm having a hard time writing a correct LCV for the while loops in my program. Also, could someone provide an explanation as to why my program freezes after it...
[4 replies] Last: while (num != 0) { num2 = num / 10; count++; //... (by kromari)
homework help
 
My program does correctly output the number of months it takes to repay the loan amount. could someone please help me figure this part out. I think its not prod...
[4 replies] Last: No I don't want to loop that code, its just an equation for the percen... (by kromari)
by HJSSAE
Starting a source code
 
I am completely new to programming, and one of my classmates told me about a way to start a code in UNIX that would show different parts of the code in differen...
[no replies]
Help explaining something
 
Could some one explain this line of my assignment further? "The function “find_e” must be contained in a separate file from the file containing the “main...
[1 reply] : It does sound like the assignment wants you to add more than one file.... (by McNo)
by Takeru
Print out Median
 
I've done the code below and read the chapter two times and tried searching for similar problems that might help me but I can't seem to know how to make the cod...
[1 reply] : Your while loop here while (cin>>temp) temps.push_back(temp);... (by McNo)
March 2016 Pages: 12345... 47
  Archived months: [feb2016] [apr2016]

This is an archived page. To post a new message, go to the current page.