📄 iword.cpp
字号:
#include <iostream.h>
#include <strstream.h>
void main( void ) {
int index1, index2;
float dollar1, dollar2;
char ch;
istrstream currency ( "23.4 26.6" );
index1 = currency.xalloc();
currency.iword( index1 ) = 36;
index2 = currency.xalloc();
currency.iword( index2 ) = 157;
currency >> dollar1;
currency >> dollar2;
cout << "Canadian currency: CAN " << ( ch = currency.iword( index1 ) )
<< dollar1 << endl;
cout << "Japanese currency: " << ( ch = currency.iword( index2 ) )
<< dollar2 << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -