Thursday, October 1, 2009

Day 4 of the first week

Yay, finally got started with C++ programming, and found that there is actually very little differences between C++ and C#, or even between other programming languages. The only differences is only the way we write it. For example, in C#, we wrote System.Out.Println("something");

In C++,its including the iostream header, followed by : cout << "something" ;

The whole code will therefore look something like this :
#include
int main()
{
cout << "something";
return 0;
}


Also with FileIO, in C++ is fairly simple :
ofstream outfile ("test.txt");
outfile << "This is the text I want to write to this file, followed by a new line character" << "\n";
outfile.close();

Yep, unbelievable, just 3 lines only!

Also learned about pointers, and that there is no ArrayList in C++ (in C#, ArrayList allow us to store, sort, remove any tye of object).

Next we moved on to OpenCV library. Unfortunately, the newly release version 2 (released just yesterday) caused many problems while installing, and eventually it took up the whole of the day. However, reading Lup Peng's blog, Open CV library seems to be able to do wonders of modifying images, and creating even special effects in them.

If only I could remote to my IHPC's computer now.....and start on discovering the magic of OpenCV...

No comments:

Post a Comment