Write in a  file in Codewarrior

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Write in a  file in Codewarrior

912 次查看
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 回复

695 次查看
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 项奖励
回复