open file stream problem

I have faced a problem that I use 2 file streams in a function and try to fopen() both files. Then I can't get the file descriptor. But if I just use 1 file stream and 1 fopen(), then i can get the file descriptor. Does anybody know why this happens? Thanks in advance.

toFileStream=fdopen(localFileDes,"a+")
toFileStream=fopen(fromFile,"r+")

Driver,

my problem is that i can't open 2 file stream in a function because there will be always runtime error. Can you show me the code that you can do that? Thanks.

problem solved again. ~~
thx