Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

read a text file on C5416 DSP

Status
Not open for further replies.

meghadaga

Newbie level 1
Joined
Apr 16, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
Hi Everyone,
I am trying to read an external txt file in C5416. I have provided proper header file; stdio.h. But somehow the file is not getting opened. I am reading it as follows:
if((fileid = fopen( "test", "r" )) == NULL )
printf( "The file 'test' was not opened\n" );
else
printf( "The file 'test' was opened\n" );

while(1)
{
if(fgets(temp, 250, fileid) == NULL)
{
exit(1);
}

sscanf(temp, "%s", &temp);
if(!strcmp(temp,"NUMCHAN"))
{
fgets(temp, 250, fileid);
sscanf(temp, "%hu", &numchan);
break;
}

}

While running the program displays the file test was not opened. I dont know why this is happening. If someone has ever read data from a file in C5416, Kindly help me out.
Waiting for reply
Thanking You
Megha Daga
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top