[ create a new paste ] login | about

Link: http://codepad.org/qc19lQ4a    [ raw code | fork ]

C, pasted on Jun 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
char* getFileData(char* fileName) {
      if(!strcmp(fileName, "filea.csd"))
            return "this is the content of the file a";
      else if(!strcmp(fileName, "fileb.csd"))
            return "this is the content of the file b";
      else if(!strcmp(fileName, "filec.csd"))
            return "this is the content of the file c";
      else 
            return "";
} 

void main () {
      char* shader = strdup(getFileData("filea.csd"));
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: