Jacob
Jacob

Reputation: 91

C++ "Program has stopped working"

I am working on a program for class. The program compiles but when I enter a value for length a window pops up saying "Pipeprogram.exe has stopped working". It then goes on to say "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available".

So far with a couple of google searches I have found no solution. If anyone could help out it would be appreciated.

enter image description here

enter image description here

enter image description here

Upvotes: 0

Views: 8320

Answers (1)

Bad Wolf
Bad Wolf

Reputation: 184

You need to pass a pointer to scanf, using an &. So,

scanf("%f", &length);

Upvotes: 5

Related Questions