How do you view the path?



How do you view the path?..

Answer / Abhishekh Kumar

"To view the current working directory in C, use the getcwd() function. It returns a pointer to an array containing the path of the current working directory. Make sure to include the header file "<stdio.h>". For example: char path[1024]; if(getcwd(path, sizeof(path)) != NULL){ printf("Current working directory: %s", path); }"n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.

2 Answers  


wt is d full form of c

6 Answers   TCS, Wipro,


Why is void main used?

1 Answers  


Why do we need a structure?

1 Answers  


How to add two numbers with using function?

2 Answers   Miracle Solutions,


What is the difference between arrays and pointers?

1 Answers  


why program counter is 16 bit?

3 Answers  


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1 Answers  


do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.

1 Answers  


what are # pragma staments?

1 Answers  


What does a function declared as pascal do differently?

1 Answers  


What are the types of functions in c?

1 Answers  


Categories