Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cout doesn't print to console

I'm working with OpenCV and C++. Have set up my project correctly, testing it by calling and displaying image, it succeed. Now I'm following simple basic tutorial for beginner and my code won't show up.

Here's the code

#include <iostream>
#include "opencv2\opencv.hpp"

using namespace std;
using namespace cv;

double square(double x) {
    return x*x;   }

void print_square(double x) {
    cout<<"Square of "<< x <<"is "<<square(x)<<endl; }

int main (int argv, char** arc) {
    print_square(2);
    waitKey(0);
}

I have also carefully set my project as Console project, still nothing show on the console. There's no error as well. Any advice ?