X return0 catch2 try3cpp void fun void try

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: argc, char *argv) { try { f1(); } catch (...) { printf("Something error! ­­ f1()\n"); } return 0; } try­catch 2 #include <stdio.h> void Read(char* file) { char buf[100]; FILE* fp; fp = fopen(file, "r"); fread(buf, 1000, 1, fp); fclose(fp); } printf("%s", buf); int main(int argc, char *argv) { try { Read("OK.txt"); } catch (...) { printf("Something error! ­­ Read()\n"); } try2a return 0; } // try2.cpp 张张张张 张张张张 第第第第第第第第第第第第 第第第第 第第第第 第第第第第第第第第第第第第第 第第第第第第第第第第第第第第 第第第...
View Full Document

This document was uploaded on 02/25/2014.

Ask a homework question - tutors are online