G
geek.arnuld
this is the programme: [1]
#include <iostream> // std::cout
int main()
{
int sum;
std::cout << sum << "\n";
}
when i compile it using gcc 4.1.2, i get this:
----------------------------------------------------------------------------
[unix@arch cpp]$ g++ first.cpp -o first
[unix@arch cpp]$ ./first
sum is: -1208774992
[unix@arch cpp]$
-----------------------------------------------------------------------------
i think the programme is wrong BUT why this does not give any error
like "uninitialised variable"?
--
http://arnuld.blogspot.com/
Linux registered user #439610
http://counter.li.org/
[1] http://home.no.net/dubjai/win32cpptut/html/w32cpptut_01_02_02.html
#include <iostream> // std::cout
int main()
{
int sum;
std::cout << sum << "\n";
}
when i compile it using gcc 4.1.2, i get this:
----------------------------------------------------------------------------
[unix@arch cpp]$ g++ first.cpp -o first
[unix@arch cpp]$ ./first
sum is: -1208774992
[unix@arch cpp]$
-----------------------------------------------------------------------------
i think the programme is wrong BUT why this does not give any error
like "uninitialised variable"?
--
http://arnuld.blogspot.com/
Linux registered user #439610
http://counter.li.org/
[1] http://home.no.net/dubjai/win32cpptut/html/w32cpptut_01_02_02.html