http://www.exforsys.com/tutorials/c-...-pointers.html
the tutorial above is referred.
i follow the instruction in the tutorial, unfortunately, when i try to compile it, some error was occurred...
and this is the error...Code:main() { int *ptr; int sum; sum=45; ptr=? printf (“\n Sum is %d\n”, sum); printf (“\n The sum pointer is %d”, ptr); }
mmm...what was happened..i followed exactly the tutorial, but still have some error...Code:Compiler: Default compiler Executing g++.exe... g++.exe "D:\C\pointer\04.cpp" -o "D:\C\pointer\04.exe" -I"d:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"d:\Dev-Cpp\include\c++\3.4.2\backward" -I"d:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"d:\Dev-Cpp\include\c++\3.4.2" -I"d:\Dev-Cpp\include" -L"d:\Dev-Cpp\lib" Executing g++.exe... g++.exe "D:\C\pointer\04.cpp" -o "D:\C\pointer\04.exe" -I"d:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"d:\Dev-Cpp\include\c++\3.4.2\backward" -I"d:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"d:\Dev-Cpp\include\c++\3.4.2" -I"d:\Dev-Cpp\include" -L"d:\Dev-Cpp\lib" D:\C\pointer\04.cpp: In function `int main()': D:\C\pointer\04.cpp:6: error: expected primary-expression before '?' token D:\C\pointer\04.cpp:7: error: stray '\147' in program D:\C\pointer\04.cpp:7: error: stray '\' in program D:\C\pointer\04.cpp:7: error: `n' undeclared (first use this function) D:\C\pointer\04.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.) D:\C\pointer\04.cpp:7: error: stray '\' in program D:\C\pointer\04.cpp:7: error: stray '\148' in program D:\C\pointer\04.cpp:7: error: `printf' undeclared (first use this function) D:\C\pointer\04.cpp:7: error: expected `:' before ';' token D:\C\pointer\04.cpp:7: error: expected primary-expression before ';' token D:\C\pointer\04.cpp:8: error: stray '\147' in program D:\C\pointer\04.cpp:8: error: stray '\' in program D:\C\pointer\04.cpp:8: error: stray '\148' in program Execution terminated