how to find the scope/definitions of a class/methods ?
In Windows environment when I used Borlan for C/C++ compilation, I was used to find the the scope/definitions of the methods/classes by pressing
Code:
ctrl + F1 Code:
//atoi.cc Code:
[mq15@localhost c-c++_files]$ c++ atoi.cc -o atoi Code:
[mq15@localhost c-c++_files]$ c++ --version |
Code:
$ man atof |
two more confusions
Thanks.
1.1 If man shows manual of bash commands/utilities, how it is showing the manual of a c/c++ method i.e. atof()? 1.2 If atof() is not a c/c++ method, but it is a bash command/utility, then how we can use a bash command/utility i.e. atof() in a .cpp source file? 2. I have included stdlib.h and atoi.cpp is compiled with no errors, yet the result is not what I expect: Code:
[mq15@localhost c-c++_files]$ ./atoi 5.4 6 What I expect is: Code:
[mq15@localhost c-c++_files]$ ./atoi 5.4 6 See the cource code of atoi in post#1 Best Regards |
1.1: Magic
1.2: atof is neither a c/c++ class/method nor a bash command/utility 2.0: Of course the result is not what you expect. This is a consequence of the fact that you do not know what argv[0] is supposed to be. P.S.: Conduct the following experiment: write a C program which prints argv[i] (0 <= i < argc) on separate lines. |
1.1 Still not satisfied :(
1.2 Then what atof actually is ? 2.0 Got it now. argv[0] holds the string the file was invoked with, in the terminal. argv[1], argv[2]...argv[i] are supposed to be string values. Code:
//arguments.cc Code:
[mq15@localhost c-c++_files]$ ./arguments str 5 6.7 For example if I use Code:
cout<<"Hello World"; Code:
‘cout’ was not declared in this scope |
Put this before the main funciton in your c++ code. You'll be able to compile the C++ code
using namespace std; |
All times are GMT -5. The time now is 05:16 AM. |