357mag 2 Posted 20 hours ago Here is one of my projects which was written in an earlier version of C++ Builder. You will notice that I'm using #include<conio.h> plus I'm using getch(); // This program demonstrates writing a simple function to cube a number #include <iostream> #include <conio.h> using namespace std; int cube(int y); // function prototype int main() { int x; cout << "Enter an integer value: "; cin >> x; int answer = cube(x); // call the cube function and pass x as an argument and assign result to the variable answer cout << "That number cubed is " << answer << endl; // print the result getch(); return 0; } int cube(int y) // function definition { return y * y * y; } Share this post Link to post
Remy Lebeau 1435 Posted 13 hours ago (edited) And, the point of this post is... what, exactly? I don't see a question or problem stated. However, why were you ever mixing C's <conio.h> with C++'s <iostream> in the first place? Get rid of <conio.h>, you don't need it. Use std::cin.get() instead of getch(). Edited 13 hours ago by Remy Lebeau Share this post Link to post