Beginners - October 2018 (Page 20)

SOS idk how to declare this thing
 
#include <iostream> #include <ctime> #include <cstdlib> #include <valarray> using namespace std; int main() { val seed=let val m=Date.minute(Dat...
[4 replies] Last: For added fun, this is a triple post: http://www.cplusplus.com/forum/... (by MikeyBoy)
Calculations for areas
 
I'm having trouble with the calculations running correctly for the area of a circle and the area of a square. I don't how to fix it. #include <iostream> ...
[3 replies] Last: Thank you and yea I can tell a lot could be shortened. Our professor g... (by joeyt2929)
by Seyter
Corrupted Compiler
 
I made this program to determine the biggest value among 5 numbers using thus format. However I have error during compile. Does it because my compiler is corrup...
[9 replies] Last: Ok I am going to give you the showed-effort award and fixed it for you... (by jonnin)
2 numbers in one function
 
How do you return 2 numbers in one function? Thanks for answering. #include <iostream> using namespace std; int swap(int &, int &); int main () { ...
[2 replies] Last: Look at http://www.cplusplus.com/reference/algorithm/swap/ How does it... (by keskiverto)
FileHandling in Class
 
How can you run fstream in Class? Can you tell me what wrong with my code, my code is about file handling more of like a attendance in a company. I have a Emplo...
[6 replies] Last: Hello wannabeako, My problem is that how can you run Fstream/file ha... (by Handy Andy)
problem understanding a paragraph in c++ primer
 
A decimal literal has the smallest type of int, long, or long long (i.e., the first type in this list) in which the literal’s value fits. Octal and hex...
[2 replies] Last: you can also force them, eg 123ull is an unsigned long long even thou... (by jonnin)
Coverting this code to c++
 
I need help converting this code into a c++ code. subroutine init ! initialization of MD program sumv(1:3) = 0. ! sum of velocities along each coordinate ...
[7 replies] Last: Im having enough trouble getting up to date on C++! I probably won't... (by jonnin)
<< requires exactly one argument
 
I keep getting this error with my code. ostream& Set::operator<<(ostream& out, const Set& v){ out << v.toStr(); return out; } Here is a h...
[2 replies] Last: To explain further: You can define the streaming operator either to b... (by MikeyBoy)
by Satan
Should I use char over string for immutable strings?
 
I'm making an arithmetic parser which would have a static input. So should I use int parser(const *char = "5+5+5") {} or int parser(string *char = "5+5+5") {}...
[4 replies] Last: int parser(const *char = "5+5+5") {} //this won't compile either, for... (by jonnin)
Cannot fix random number tally program
 
I dont know what else I need to do to make the program work. The code has comments for clarification. #include <iostream> #include <ctime> ...
[4 replies] Last: This [...] Is the same as this [...] Although note that if i > 6, t... (by MikeyBoy)
Help with the question
 
In the magical land of Byteland, there are three kinds of citizens: a Bit - 2ms after a Bit appears, it grows up and becomes a Nibble (i.e. it disappears and...
[1 reply] : If this is a Codechef problem, you should know that the Codechef adjud... (by MikeyBoy)
Iteration with randomly generated values
 
This code generates random values for the x, y, and z position of each particle up until the number of particle inputted by the user. #include <cstdlib> #in...
[5 replies] Last: I'm trying to calculate the potential energy Really? I mean, will y... (by keskiverto)
Need help in optimization!
 
Appy loves balloons! She wants you to give her balloons on each of N consecutive days (numbered 1 through N); let's denote the number of balloons Appy wants on ...
[7 replies] Last: Well, the participants now know that the Codechef adjudicators are mon... (by MikeyBoy)
Conversion error
 
Hey, Trying to get a function to return an array of class String but cannot figure it out. The error is that there is no suitable conversion from String to in...
[7 replies] Last: The code actually works because of the other overloaded operators tha... (by keskiverto)
[1st year University Comp Sci] Creating a deck of cards using Structs
 
So I've been a little pressed for time the past couple days and have this somewhat large assignment due in 2 days. But I can't even figure out how to get starte...
[2 replies] Last: Your Deck struct should be called Card since a deck is a collection of... (by Thomas1965)
Boolean loop not working correctly
 
I have written the program below and it runs successfully but when the menu choice is input, it just reruns the loop. How can I correct this? #include<io...
[5 replies] Last: char userSelection; const char PROCESS = '2'; if (userSelection == I... (by keskiverto)
Ascii game codding
 
How to code a game using ascii way? Please help me with this, I'm a newbie in codding c++. Thank you!
[2 replies] Last: Can I have sample of codes like how to make a 2d map, player, enemies,... (by Ericopawn)
fileio problems with fout
 
Write your question here. #include <iostream> #include <string> #include <iomanip> #include <fstream> #include <cassert> using namespace std; double ...
[1 reply] : What's the problem? (by kbw)
by Cairus
Getting Trash Output- no undefined variable
 
There is no variable where I am getting the output. it is the 5007465 number. it happens no matter which if or else if or else path I go down --Triangl...
[1 reply] : triangleType() returns an int, which you are sending to std::cout on l... (by helios)
Comparison between two strings
 
(This is part of the solution of Exercise 2.6 in Essential C++.) I wrote a funtion to compare two value of int, double or string objects and return the max. ...
[7 replies] Last: @mbozzi @FurryGuy Thanks. I have learned about the string suffix. (by locatee)
October 2018 Pages: 1... 1819202122... 28
  Archived months: [sep2018] [nov2018]

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