can4ec Posted November 29, 2006 Report Share Posted November 29, 2006 Файл создается, цифра в него не записываются. Кто знает подскадите... #include <iostream.h> #include <stdio.h> int main() { FILE *in; in = fopen("file1.txt", "w"); cout<<"243534534"; fclose(in); return 0; } Link to comment Share on other sites More sharing options...
Bokrenok Posted November 30, 2006 Report Share Posted November 30, 2006 так ты при вызове cout указывай куда выводить то. cout<< in <<"243534534"; Link to comment Share on other sites More sharing options...
can4ec Posted December 1, 2006 Author Report Share Posted December 1, 2006 так ты при вызове cout указывай куда выводить то. cout<< in <<"243534534"; я указал , но все равно он только создаеться но не записывается. #include <iostream.h> #include <stdio.h> int main() { FILE *in; in = fopen("file1.txt", "w"); cout<<in<<"243534534"; fclose(in); return 0; } Link to comment Share on other sites More sharing options...
Amsterdam Posted December 1, 2006 Report Share Posted December 1, 2006 (edited) Сделай так: #include <iostream.h>#include <fstream.h>FILE *in; in = fopen("file1.txt", "w");fstream inout("file1.txt");inout << "243534534" << endl;fclose(in); Edited December 1, 2006 by Amsterdam Link to comment Share on other sites More sharing options...
can4ec Posted December 1, 2006 Author Report Share Posted December 1, 2006 Сделай так: #include <iostream.h>#include <fstream.h>FILE *in; in = fopen("file1.txt", "w");fstream inout("file1.txt");inout << "243534534" << endl;fclose(in); #include <iostream.h> #include <fstream.h> #include <stdio.h> int main() { FILE *in; in = fopen("file1.txt", "w"); fstream inout("file1.txt"); inout<<"dadsad"<<endl; fclose(in); return 0; } Показывает ошибку на строку fstream inout("file1.txt"); ошибка:cannot convert parameter 1 from 'char [10]' to 'int' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now