Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: C  |  size: 0.63 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse
This paste has a previous version, view the difference. Copied
  1. /*S.A hossam :D,
  2.  
  3. Lama te3ooz te3mel file gedid esmoh ( lol.txt ) betekteb :
  4. */
  5. FILE *f=open("lol.txt","w");
  6. /*
  7. Lama te3ooz te2ra men file betekteb :
  8. */
  9. FILE *f=open("lol.txt","r");
  10. /*
  11. Lama te3ooz tekteb 7aga fy file betekteb :
  12. */
  13.  
  14. fprintf(f,"Hello World");
  15.  
  16. /*
  17. lama te7eb tekteb ay 7aga be arguments gowa file betekteb :
  18. */
  19.  
  20. char *x="Hossam";
  21. fprintf(f,"Hello %s",*x);
  22.  
  23.  
  24. /*
  25. Lama te7eb ta5od inputs men file betekteb :
  26. */
  27.  
  28. fscanf(f,"%d");
  29.  
  30. /*
  31. ya2ema betesta3mel fgetc();
  32. */
  33.  
  34. int x=fgetc(f);
  35.  
  36. /*
  37. we 3ala fekra fgetc() dih kman betosta3mal fel C++ :
  38. http://www.cplusplus.com/reference/clibrary/cstdio/fgetc/
  39. */