All pastes #235448 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2006-11-03 06:50 UTC
rendered paste body
#include <cstdlib>#include <iostream>#include <fstream>#include <string>using namespace std;void version(int a){int ver=a;cout << "weight version: " << ver <<endl;};/*this gives me the errorvoid filewritez(char a, int sizez){     string file1;     file1 = a;//     float file2 = b;     ofstream filez ( "file1" ); //suspect line     filez << "you weigh " << sizez << "lbs fatty." << endl;     filez.close();};*///this gives me 30 C:\dev\cpp\testicles\main.cpp no matching function for call to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::string&)' void filewritez(char a, int sizez){     string file1;     file1 = a;//     float file2 = b;     ofstream filez ( file1 ); //suspect line     filez << "you weigh " << sizez << "lbs fatty." << endl;     filez.close();};int main(){    version(4);    int sizez; //k i need this in filewritez()    cout << "how much do you weigh? (lbs)" <<endl;    cin >> sizez;    cout << sizez << "LBS! WOW!" << endl;        filewritez();    system("PAUSE");    return EXIT_SUCCESS;}