Write in a  file in Codewarrior

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Write in a  file in Codewarrior

982 Views
Idontunderstand
Contributor I

hi Guys;

I include the following library in my code.

#include <stdio.h>
#include <stdlib.h>

 

i want to open a file and save what ever i get in debugger during running my experience.

Why this line of code doesn't work :

File *fp;

fp=fopen("C:\test.txt","w");

 

it gace error L1822 : for float number! although I add ansibi.lib. Without these two line, my code works fine.

Could you please share me your experinece?

 

 

Thanks;

Labels (1)
0 Kudos
Reply
1 Reply

765 Views
CrasyCat
Specialist III

Hello

 

The manual Compiler_HC12.pdf states that

 

"The ANSI–C library contains a fairly large interface for file I/O. In microcontroller

applications however, one usually does not need file I/O. In the few cases where one

would need it, the implementation depends on the actual setup of the target system.

It, is therefore impossible for Freescale to provide an implementation for these

features that the user has to specifically implement"

 

Basically usage of fopen, fprintf functions implies that there is a file system on the target. We do not provide a file system with our HC12 library.

 

What are you trying to achieve with those File IO functions?

 

CrasyCat

0 Kudos
Reply