ok so I've got to make a program that converts centimeters to inches and then converts that amount of inches into the respective yards, feet and inches displayed for the user. When I run my program, I type the amount of centimeters to be calculated and in about a half a second it processes it and closes the window, wtf? so I put a system ("pause"); right before the return 0; and everything runs like it should except it gives me an error, I think thats what it is anyways, which says:
"CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. the "above path" is:
\\acad.dvuadmin.net\sce\HOMEDIR\(my student ID)\Documents\visual studio 2010\projects\part 2, problem 2\part 2, problem 2'
Here's what I've got so far. I've been tinkering with this for two days with no help and I'm getting nowhere, someone please help me out here, where is my mistake?
It appears you're running this over the network and your system doesn't support the network path as the working directory for the program. The warning is to let you know, so if for instance you were handling files, using relative paths, you won't be surprised to find they're not using the programs location as the starting point.
You're not doing this, so your program should work well. Also, about system("pause"), check out the discussion at: http://www.cplusplus.com/forum/beginner/1988/
I'm quite alright with being known as a beginner at C++ because I definitely am so I'll continue to use system pause for a while longer. Thank you for the info and the reason for that extra stuff at the end of my program! However, after running this program with different variables input as the centimeter amount, my computed numbers aren't right at all. I used 300 cm to test the program out further instead of the 312cm that I was suppose to use and I started getting negative numbers. Could someone please tell me where I messed up in my calculations part? did I type something backwards? forget to add a part?
Good point, not sure why I went ahead and put the "12" on the end. I changed the "in" declaration but it when I use the first input variable I have to use(312cm) it still gives me 3 yards, 1 foot, and 2 inches and it should be 3 inches. Do I need to declare "totalinches" as a double or float instead of an int to get it to stop rounding to a whole number?