Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I am trying to write a program (c++ console application) that calculates the n-th root of a number, where the n and the number are input from keyboard, but I don't know how (sorry for bad English). Can someone please write this program for me so I can see how it's done. Btw I'm new to programing so please make it as simple as possible. Thanks
Best way I think
double NthRoot(double value, double degree)
{
return pow(value, (double)(1 / degree));
}
From here.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I can't figure out a way to pull out two numbers in a string and save them in a different variable in classic asp.
The string is:
"\1800_411.pdf.log"
All I was trying to do is to save the first number which is 1800 in a variable and save the 411 in a different variable
What about:
(\d+)_(\d+)
This would save them into two capturing groups. See here: https://regex101.com/r/v83Zbt/1
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
}
but when I run it it says segmentation fault and apart from that, I don't know if the code is correct.
You have a j++ at line 18 that was almost certainly supposed to be a g++. Also, your x+=g; on line 19 is probably supposed to be an x++. You only want to add one each time.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
So I'm brand new to c++ and just started the beginner class. The professor has given us the exact prompt to put into the program and I am still receiving an error. I have checked over and over for any small flaws such as spacing or random ";" that a lot of people seem to do, but still no results. Can anyone see anything wrong with what I have down?
Remove asterisk (*) right below "//Purpose of this program ..." and try it again.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
So I am trying to make a simple program (I'm a student) and it works fine so far, but I can't figure out how to display the "i" value from the loop in the drawCircle() function in Shapes.cpp
code:
http://pastebin.com/4kDPNjy8
example:
When I compile my code right now it looks like on the image to the left, but I want to get something like on the right but I have no idea how to do that kind of stuff or what function should I use for that.
Please help
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, char(i));
Should do it. But before that, you probably want to calculate position of each number, so do it, and then call:
glRasterPos2f(X_pos, Y_pos);
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I want to detect if a window/process is running, and if it does, to make the c++ program close.
Something like this:
if (FindWindow(NULL, TEXT("Fiddler"))) {
;
std::exit
;
}
It doesn't works for some reason.
WHy do you have random semi-colons floating in space?
This code should look like:
if (FindWindow(NULL, TEXT("Fiddler")) != NULL)
{
std::exit(0);
}