Why cant I open a file by its explicit path?



Why cant I open a file by its explicit path?..

Answer / Manorama Devi

In C, you cannot open a file using an explicit path in the command line (e.g., `open("C:myfile.txt")`) because it is not how C's standard library works. Instead, use functions like `fopen` or `freopen` with the appropriate file modes to open files.n```cnfopen("C:myfile.txt", "r"); // opens myfile.txt in read mode```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

write a program in c to print **** * * * * ****

1 Answers   TCS,


What does char * * argv mean in c?

1 Answers  


What is getch() function?

1 Answers  


Is c easy to learn?

1 Answers  


Explain is it valid to address one element beyond the end of an array?

1 Answers  


find the size of structure without using the size of function

1 Answers   Bosch,


write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }

1 Answers  


What is function in c with example?

1 Answers  


What are pragmas and what are they good for?

1 Answers  


How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST

6 Answers   Adobe, Huawei,


Why header files are used?

1 Answers  


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

1 Answers   Case, IBM,


Categories