Beginners - February 2019 (Page 20)

Conversion from const char* to char*
 
Is it possible to make such conversion because in our university we are asked to use char * for every attribute that has a name.For example a class Person has c...
[2 replies] Last: const_cast can be your friend. https://en.cppreference.com/w/cpp/lang... (by closed account E0p9LyTq)
need help with coin counter
 
mostly I just wanna know what's wrong with the void. #include <iostream> #include <cmath> void coindivision(int Quarters, int Dimes, int Nickels, int P...
[3 replies] Last: Look closely at line 25. The semi-colon at the end. You are not defi... (by closed account E0p9LyTq)
help
 
Still kind of new at this, but I am trying to write code to do a few different things. I would like it to count odd and evens, display the prime numbers,and I w...
[4 replies] Last: Thank you all, I will keep working on it. I appreciate it. (by jbennett)
Need help with tax program
 
I have to define a c++ function to calculate the marginal tax rate on a given amount of income. We're given the function double federalTax(double income) and th...
[3 replies] Last: #include <iostream> using namespace std; double federalTax(double)... (by H00G0)
how do I shift a strings characters over 1 (a -> b)
 
so I'm having troubles trying to shift my string that the user inputs over by a random number which is generated between 1-10 (for example: input: coffee random...
[2 replies] Last: what if i had to use a while loop and a at()? to get the random letter... (by colton96)
by cutwo
Help-copying output to txt
 
Hello, I am trying to create a program that will run in the console with "Hello World" and then copy that output into a text. Could you please tell me how...
[6 replies] Last: if you must use a char array on a fixed value, use with no size at a... (by jonnin)
by isida
How can I make my character jump?
 
Hello, I'm trying to make my character jump when espace key is pressed. However when I press espace key nothing happin. When I run the program It doesn't ...
[12 replies] Last: thank you very much.. I will start right away! (by isida)
Insertion Sort
 
Hello friends, Im pretty stumped, not sure where I'm going wrong. Sometimes I get the correct output and other times if I switch the numbers around in an array...
[2 replies] Last: Thank you, I will go ahead and fix that. (by jgialis)
How to change directory cmake uses for reading/writing to files?
 
At the current moment my project struture in clion is along the lines of: -main.cpp -CMakeLists.txt -cmake-build-debug/example.txt I notice that when i want t...
[1 reply] : Hello bigpops, I am not the pest person to answer this, but at least ... (by Handy Andy)
Runge- Kutta Method
 
Hello, I am supposed to implement the Runge Kutta Method of order 4 for a scalar first-order ordinary differential equation. In the end, I should be able to co...
[no replies]
calling a string
 
**THIS IS A CODE GIVEN TO ME BY ANOTHER USER** i got stuck on lines 6, 7, 8 because i cant call the string. #include <iostream> #include <math.h> u...
[4 replies] Last: also, he gave me that code to help me with a different problem that, h... (by gitelmana)
Help with error "no known conversion from 'double' to 'double (*)(double)" when converting ?
 
Hi, I want to print looping value from a function in terminal. I have a conversion function, here : void spectrum_to_xyz(double (*spec_intens)(double wavel...
[4 replies] Last: Please post your revised code. Below. (by lastchance)
Help With Rectangle/Ellipse Image Drawing
 
Hello, I currently need to write a program for my class that continuously requires me to give the user 3 choices of either drawing a rectangle, an ellipse, o...
[2 replies] Last: #include <iostream> #include <algorithm> #include <cmath> using names... (by lastchance)
Thread invalid use of ‘this’ in non-member function
 
I'm trying threads for the first time and I've run into an error when attempting to implement in main. main { tm time1; //set up time1; std...
[6 replies] Last: Add -pthread to the link options too: LDFLAGS = -pthread ... (by JLBorges)
Two loops into Recursive
 
Hello, I was trying to convert these nested loops into a recursion form, this is my first time and i need assistance. for (i = 0; i < 2 * n ; i...
[2 replies] Last: #include <iostream> #include <iomanip> int loop( int counter, int j ... (by JLBorges)
Chef with Orchestra in the Kitchen
 
Chef has a large orchestra in his kitchen and he is preparing for a concert next week. He also has a music score, which is represented by a string S with length...
[1 reply] : OK, so what's your question and where is your code? (by salem c)
Should I quit?
 
I somehow managed to pass the 1st semester but things are getting tough now. The difficulty level of assignments and quizzes is increasing. My friends laugh at ...
[9 replies] Last: One more thing that you should consider is the power of the wonderful ... (by Grime)
by dutch
MagicJar
 
Example input: 3 4 1 2 3 4 4 7 3 5 2 3 1 5 10 Example output: 7 14 14 I'm not entirely sure if these are correct, though. I interpret the question as asking...
[no replies]
How to make this program?
 
I am working on a program that should make learning foreign words easier. first I typed int with 40 different symbols (so it would be 20 words) Than i typed "...
[3 replies] Last: Here I made a small program which can read in a file with word pairs a... (by nuderobmonkey)
Coding problem
 
Can somebody explain why i am getting the wrong answer? https://www.codechef.com/FEB19B/problems/HMAPPY2 #include <iostream> using namespace std; ...
[8 replies] Last: I don't believe you. :-) (by dutch)
February 2019 Pages: 1... 181920212223
  Archived months: [jan2019] [mar2019]

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