Write in a  file in Codewarrior

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Write in a  file in Codewarrior

983件の閲覧回数
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;

ラベル(1)
0 件の賞賛
返信
1 返信

766件の閲覧回数
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 件の賞賛
返信