#include stdio.hint main (){FILE * p;char buffer[] = { 'a' , 'b' , 'c' };p = fopen ( "myfile.txt" , "wb" );fwrite (buffer , 1 , sizeof(buffer) , p );fclose (p);return 0;}
#include iostream#include fstreamusing namespace std;int main (){int length;char * buffer;ifstream is;is.open ("word", ios :: binary );is.seekg (0, ios :: end);length = is.tellg();is.seekg (0, ios :: beg);buffer = new char [length];is.read (buffer, length);is.close();cout.write (buffer, length);delete[] buffer;return 0;}
#include iostreamusing namespace std;int main( ){char line[8];cin.getline( line, 8, 'g' );cout line;return 0;}
#includestdio.hint main(){int a=44,b=69,c,temp;float p=4.6,q=7.8;double m=65.7,n=59.6;long long int x=50,y=90;printf("a=%d and b=%d before swapping:\n",a,b);temp=a;a=b;b=temp;printf("a=%d and b=%d after swapping\n",a,b);printf("\np=%f and q=%f before swapping:\n",p,q);p = p + q;q = p-q;p = p-q;printf("p=%f and q=%f after swapping\n",p,q);printf("\nm=%lf and n=%lf before swapping:\n",m,n);m=m*n;n=m/n;m=m/n;printf("m=%lf and n=%lf after swapping\n",m,n);printf("\nx=%d and y=%d before swapping:\n",x,y);x=x^y;y=x^y;x=x^y;printf("x=%d and y=%d after swapping\n",x,y);return 0;}
#includeiostreamusing namespace std;void Execute(int &x, int y = 200){int TEMP = x + y;x+= TEMP;if(y!=200)coutTEMPxy"--";}int main(){int A=50, B=20;coutAB"--";Execute(A,B);coutAB"--";return 0;}