File types used in C++

Hey,

Does anyone know there general limitations as to which file types you can and cannot open and manipulate in C using fopen(), fscanf(), etc.?
I wrote a program to create and open every possible three letter extension. from ".aaa" to ".zzz".
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>

int main(){
	for(int i = (int)'a'; i <= (int)'z'; i++){
		for(int j = (int)'a'; j <= (int)'z'; j++){
			for(int k = (int)'a'; k <= (int)'z'; k++){
				char filename[6];
				filename[0] = 'a';
				filename[1] = '.';
				filename[2] = (char)i;
				filename[3] = (char)j;
				filename[4] = (char)k;
				filename[5] = '\0';
				FILE * pFile;
				pFile = fopen (filename,"w+");
				if (pFile!=NULL){
					fputs ("fopen example",pFile);
					fclose (pFile);
				}
			}
		}
	}
}

It was a 100% success.

So... There are no files that you can't open.
No limitations you can even create your own file types with your own extensions.

Jeff.
I think the naming does not matter. The reason is that the program always reads the file in binary stream(at least for Linux it does, not sure for Windows). If you specify to read the file in char mode, the program will read 8 bits and convert it to specific character after while binary reads a single bit with no conversion. That's the only difference between the binary mode and character mode.
Topic archived. No new replies allowed.