(TIP) Be careful when you use this type "unsigned long long type"


Firstly, refer to this webpage(http://stackoverflow.com/questions/2844/how-do-you-printf-an-unsigned-long-long-int)


unsigned long long -> %llu

When you use this type -> unsigned long long llType;
You have to be careful when you use :printf, fprintf, sprintf...
you have to use "%llu".
ex) printf("%llu", llType);

Or, You will meet this problem.

Source:
unsigned long long int num = 285212672; 
int normalInt = 5;      
printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt);

Output : 
My number is 8 bytes wide and its value is 285212672l. A normal number is 0.




I takes about 2hours to solve this problem...





Comments

Popular posts from this blog

(OpenCV Study) Background subtractor MOG, MOG2, GMG example source code (BackgroundSubtractorMOG, BackgroundSubtractorMOG2, BackgroundSubtractorGMG)

OpenCV Stitching example (Stitcher class, Panorama)

AMP dose run on my pc?, AMP(Accelerated Massive Parallelism)

Example source code of extract HOG feature from images, save descriptor values to xml file, using opencv (using HOGDescriptor )

Optical Flow sample source code using OpenCV

Real-time N camera stitching Class.

OpenCV meanShiftFiltering example source code ( cpu: pyrMeanShiftFiltering, gpu:meanShiftFiltering, gpu:meanShiftSegmentation )

8 point algorithm (Matlab source code) / The method to get the Fundamental Matrix and the Essential matrix

Image warping (using opencv findHomography, warpPerspective)

Video Stabilization example source code, (using cvFindHomography, cvWarpPerspective functions in openCV)