|
INTERVIEW QUESTIONS
C
VARIABLES IN C
DETAILS
Question: What are comment line arguments in C programiing? and also give an example.
Answer: Command line argument are used in main function. By using this we can input the values with out using scanf or any other input function. eg: main(int argc,char *argv[]) { printf("%d",argc);/*prints the size of the argv array.*/ printf("%s%s%s",argv[0],argv[1],argv[2]); /*argv[0] prints object file i.e., a.out. argv[1] prints the first element argv[2] prints the second element and so on.*/
|
|
|
Category |
Variables in C Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8338 users |
Added on |
2/23/2013 |
Views |
73094 |
Rate it! |
|
|
Question:
What are comment line arguments in C programiing? and also give an example.
Answer:
Command line argument are used in main function. By using this we can input the values with out using scanf or any other input function. eg: main(int argc,char *argv[]) { printf("%d",argc);/*prints the size of the argv array.*/ printf("%s%s%s",argv[0],argv[1],argv[2]); /*argv[0] prints object file i.e., a.out. argv[1] prints the first element argv[2] prints the second element and so on.*/
Source: CoolInterview.com
Answered by: syeed | Date: 6/23/2008
| Contact syeed
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How much memory does a static variable takes?
|
View Answer
|
|
A variable carries a value.(already assigned OR from Scanf..what ever the way). I want to know whether the variable is positive or negative. Conditions: ----------- 1.NO looping logic should be used such as for ..while..etc.
2.should not use > or <.
3.should not use any numbers except 0. We can use 0 and equality operator. How to know the number is positive or negative?
|
View Answer
|
|
How much memory does a static variable takes?
|
View Answer
|
|
Where does global, static, local, register variables, free memory and C Program instructions get stored?
|
View Answer
|
|
1)What is static identifier?
2)Where are the auto variables stored?
|
View Answer
|
|
What is the benefit of using const for declaring constants?
|
View Answer
|
|
What is the difference between declaring a variable and defining a variable?
|
View Answer
|
|
What is an lvalue?
|
View Answer
|
|
Can static variables be declared in a header file?
|
View Answer
|
|
Can a variable be both const and volatile?
|
View Answer
|
|
What is the type of the variable b in the following declaration? #define FLOATPTR float* FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer
|
View Answer
|
|
A switch statement cannot include
a) constants as arguments b) constant expression as arguments c) string as an argument d) None of the above
|
View Answer
|
|
How to swap the content of two variables without a temporary variable
|
View Answer
|
|
Where are the auto variables stored? What is the use of register variables?
|
View Answer
|
|
What is an lvalue?
|
View Answer
|
|
Can a variable be both const and volatile?
|
View Answer
|
|
How can you determine the maximum value that a numeric variable can hold?
|
View Answer
|
|
Is it acceptable to declare/define a variable in a C header?
|
View Answer
|
|
What is the difference between declaring a variable and defining a variable?
|
View Answer
|
|
Can static variables be declared in a header file?
|
View Answer
|