bonjour à tous,
La fonction FcIntStr,dont code ci-dessous, ne répond pas à mon attente.
Je voudrais une sortie sous les lignes Ch ou CA de préférence à celle de St.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
 
//essai 
//#include <string>
#include <iostream>
#include <sstream>  
//#include <fstream>
 
using namespace std;
 
string FcIntStr(int NbA,string ChA,int fcvue)
{//29/12/11/22h
//IntVerStr=FcIntStr(nb,ch,fcvue); 
     ostringstream ossNbA;
     ossNbA<<NbA;
     ChA=ossNbA.str();
return ChA;      
}//29/12/11/22h
 
int main()
{   
    int fcvue=0;
    cout<<"essai int vers string"<<endl; 
    int nb=15;
    string Ch;
    string ChA;
    string IntVerStr;
 
    IntVerStr=FcIntStr(nb,Ch,fcvue);
 
    cout<<"St "<<IntVerStr<<endl;
    cout<<"It "<<nb <<endl;
    cout<<"CA "<<ChA<<"*"<<endl;//pourquoi vide?  
    cout<<"Ch "<<Ch <<"*"<<endl;//pourquoi vide?
 
    cout<<"<E>";cin.get();
}
La fonction doit être mal écrite()?
Merci pour cette étude.