Pages

Tuesday, May 15, 2012

WinToFlash - Install Windows from usb







Hi..

Wintoflash is a great software that help you creating windows usb bootable so that you can clean install or repair your computer using usb. say no more to DVD installer hehe...

the advantage using usb is, usb have higher read rate compare to dvd. so when you load up the installer resource, it faster compare to dvd. it also make life easier when it has no problem like dvd has. (disk failure, disk scratch) .

here is the web 
WinToFlash - Install Windows from usb

support the creator by donate for the software.

p.s: this software is mark as BETA... but actually it is can perform well... ^_^






Sunday, February 27, 2011

File operation in C programming(text file method)

There are two type file operation. One is using text file method and another one using binary file method. The method is for text file method.

First step is to define


FILE *
example :
FILE *ifile;
FILE *book;

Then to open a text file in c programming

function : fopen()
format : fopen("filename",mode);
mode:
"r" = read only
"w" = write only(start from beginning file-replace all previous data)
"a" = write only(start at end file- if got data in the data, it will not be replace)
"r+" = open to update the data(read and write)
"w+"= open to update the data(create,read and write)

example
fopen("book.txt","w");
fopen("new/inputfile.text","r");

note: only one mode in one fopen statement. cannot use"rw". can open a file to write and to read but once open to read must close it first to reopen for write operation.

To write to the text data

function : fprintf()
format : fprintf(FILE *,"",);
example:
fprintf(FILE *ifile, "%d\n", int data);
fprintf(FILE *book,"%c\n", char books);

To read from text file

function: fscanf()
format: fscanf(FILE *,"",);
example:
fscanf(FILE *ifile, "%d\n", int data);
fscanf(FILE *book,"%c\n", char books);

To close the text file

function : fclose()
format: fclose(FILE *);
example:
fclose(ifile);
fclose(book);

Full sequence in a main function

void main()
{
FILE *ifile;
FILE *book;
char books[10];
int data;

fopen("/new/inputfile.text","r");
fopen("book.txt","w");

fscanf(ifile, "%d\n",data);

fprintf(book,"%c\n",books);

fclose(ifile);
fclose(book);

return;
}