在c ++中使用Fortran的格式命令 [英] i/o Fortran's format commands in c++

查看:84
本文介绍了在c ++中使用Fortran的格式命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经决定是时候从fortran迁移到c ++了,但是如果c ++支持I / O格式的命令就像在fortran 77中那样,我就无法找到



我会感激任何帮助。

谢谢

I ''ve decided it''s time to move from fortran to c++, but i cant find
out if c++ supposrts I/O format commands like the ones in fortran 77.
I would be gratefull for any help.
Thank you

推荐答案

maria写道:
maria wrote:
我已经决定是时候从fortran迁移到c ++了,但是如果c ++支持I / O格式的命令就像在fortran 77中那样我无法找到

我很感激你的帮助。
谢谢你
I ''ve decided it''s time to move from fortran to c++, but i cant find
out if c++ supposrts I/O format commands like the ones in fortran 77.
I would be gratefull for any help.
Thank you




你假设我们认识Fortran。为什么不首先描述IO应该如何表现




雅克



You assume we know Fortran. Why not describe how the IO should behave
first?

Jacques


2004年1月13日19:40:25 -0800 comp.lang.c ++, ma ***** @ hotpop.com

(玛丽亚)据称写了:
On 13 Jan 2004 19:40:25 -0800 in comp.lang.c++, ma*****@hotpop.com
(maria) was alleged to have written:
我已经决定是时候从fortran转到c ++,但我找不到
如果c ++支持I / O格式命令,例如fortran 77中的命令。
I ''ve decided it''s time to move from fortran to c++, but i cant find
out if c++ supposrts I/O format commands like the ones in fortran 77.




C ++继承的printf(),scanf()等库函数来自C的
,提供格式化的I / O,有点让人联想到Fortran格式化的

I / O.大多数C ++程序员更喜欢标准的iostreams库,以确保

类型的安全性和可扩展性。


请参阅[15]输入/输出部分< iostream>和< cstdio>"在

Marshall Cline的C ++常见问题解答中。

发布之前查看常见问题解答总是好的。您可以在以下网址获取常见问题解答:
http:// www。 parashift.com/c++-faq-lite/


maria写道:
maria wrote:
我已经决定是时候从Fortran迁移到C ++
但是我不知道C ++是否支持I / O格式命令,就像fortran 77中那样。
I ''ve decided that it''s time to move from Fortran to C++
but I can''t find out if C++ supports I/O format commands
like the ones in fortran 77.




为什么你找不到?

你有C ++教科书吗?


C计算机编程语言有格式*字符串*

PRINTF(3)Linux程序员手册PRINTF(3)


名称

printf,fprintf ,sprintf,snprintf,vprintf,vfprintf,

vsprintf,vsnprintf - 格式化输出转换


概要

#include< stdio .h>


int printf(const char * format,...);

int fprintf(FILE * stream,const char * format,.. ); <无线电通信/>
int sprintf(char * str,const char * format,...);

int snprintf(char * str,size_t size,const char * format,...) ;



Why can''t you find out?
Do you have a C++ text book?

The C computer programming language has format *strings*
PRINTF(3) Linux Programmer?s Manual PRINTF(3)

NAME
printf, fprintf, sprintf, snprintf, vprintf, vfprintf,
vsprintf, vsnprintf - formatted output conversion

SYNOPSIS
#include <stdio.h>

int printf(const char *format, ...);
int fprintf(FILE *stream, const char *format, ...);
int sprintf(char *str, const char *format, ...);
int snprintf(char *str, size_t size, const char *format, ...);


这篇关于在c ++中使用Fortran的格式命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆