Issues about Compare text from a file?

Talk about making games.

Issues about Compare text from a file?

Postby macbookpro » Sat Jan 31, 2015 12:48 pm

Binh Dinh co dien tich tu nhien la 6.039 km2. Binh Dinh la 1 trong 5 tinh, thanh pho o khu vuc duyen hai Nam Trung Bo, nam trong Vung kinh te trong diem Mien Trung. Binh Dinh co vi tri dia kinh te dac biet quan trong trong viec giao luu voi cac quoc gia o khu vuc va quoc te, nam o trung diem cua truc giao thong duong sat va duong bo Bac - Nam Viet Nam, dong thoi la cua ngo ra bien Dong gan nhat va thuan loi nhat cua Tay Nguyen, Nam Lao, Dong Bac Campuchia va Dong Bac Thai Lan thong qua Quoc lo 19 va cang bien quoc te Quy Nhon.

Ngoai loi the nay, Binh Dinh con co nguon tai nguyen tu nhien, tai nguyen nhan van phong phu va nguon nhan luc kha doi dao. Binh Dinh co cang bien quoc te Quy Nhon va cang noi dia Thi Nai, trong do cang bien quoc te Quy Nhon co kha nang don tau tai trong tu 2-3 van tan, cach Phao so 0 khoang 6 hai ly, cach hai phan quoc te 150 hai ly. Binh Dinh la tinh co tiem nang ve kinh te bien; voi chieu dai bo bien 134km, vung lanh hai 2.500km2, vung dac quyen kinh te 40.000km2; co cac cang ca Nhon Chau, Quy Nhon, Tam Quan, De Gi va khu tru dau tau thuyen Tam Quan.

Xem thêm >>> Đăng ký lắp mạng internet fpt Đăk Lăk

Trong cac cang ca neu tren co cang ca Nhon Chau la tot nhat, co nguon loi hai san phong phu, gia tri kinh te cao nhu ca thu, ca ngu dai duong, ca nuc, ca trich, ca com, ca chuon, tom muc cung cac dac san quy hiem. Tai Binh dinh Cac hoat dong van hoa, the duc the thao, thong tin – tuyen truyen, bao chi, phat thanh - truyen hinhtiep tuc duoc phat huy phuc vu cho phat trien kinh te - xa hoi va phuc vu doi song van hoa tinh than cua nhan dan. Phong trao the duc the thao quan chung duoc duy tri va tung buoc xay dung, boi duong doi ngu van dong vien the thao thanh tich cao cua mot so mon co the manh cua tinh nhu vo thuat, dien kinh, boi loi, bong da… Hoat dong du lich cua Binh Dinh cung het suc soi dong. So khach du lich den tham quan, nghi duong tai Binh Dinh ngay cang tang. Mot so doanh nghiep tiep tuc dau tu nang cap co so ha tang, nang cao chat luong phuc vu, day manh noi ket tour du lich voi cac tinh trong va ngoai nuoc.

I. Dich Vu Internet FPT Binh Dinh.
Image
Voi mot so dieu kien de phat trien kinh te xa hoi muc song, thu nhap nguoi dan tinh Binh Dinh ngay mot tang, nhu cau su dung dich vu vien thong Binh Dinh Tang len. Cong ty vien thong FPT Telecom trien khai ha tang cap quang phuc vu Đăng Ký Lắp Đặt Internet FPT Bình Định – Khuyến Mãi Trong Năm cho khach hang.FPT Telecom da trien khai thanh cong ha tang lap mang fpt binh dinh ngay tai 1 vai thanh pho va thi xa tren dia ban tinh Binh Dinh tap trung dan cu sinh song va lam viec dat biet co nhu cau cao ve viec lap dat internet FPT Binh Dinh cho nguoi nha co the su dung thoai mai.

Hien cac goi cuoc cap quang FPT Binh Dinh dang khuyen mai rat re chi tu 150.000d. Lien tuc tung ra cac goi cuoc cap quang FPT moi nhat tren dia ban tinh Binh Dinh trong giai doan moi nhat tu nam 2017 – 2020, fpt telecom muon thu hut khach hang su dung mang internet FPT tai Binh Dinh nhieu hon bang viec cho ra doi nhieu goi cuoc cap quang FPT toc do cao hon, gia cuoc khuyen mai hon de khach hang chon lua su dung dich vu.

Binh Dinh la mot trong cac tinh co toc do phat trien o muc tuong doi kha o mien Trung. Do do fpt telecom da phoi hop voi 1 so don vi vien thong chinh tai khu vuc nay dau tu he thong mang luoi cap quang lap mang fpt quy nhon, fpt Bình định thay the cho cap dong ADSL truoc day de su dung. Voi tuyen cap quang FPT ma FPT telecom dau tu, khach hang co the su dung mang internet nhanh chong hon gap hang chuc lan.

II. Lap Mang Internet FPT Binh Dinh.

FPT telecom ben canh do cung tung ra rat nhieu chuong trinh khuyen mai hap dan nhu mien phi 100% phi lap dat mang FPT – tang modem wifi cap quang FPT -trang bi dau thu FPT Play TV mien phi voi dieu kien kha don gian la khach hang chi can thanh toan truoc 6 – 12 thang cuoc dich vu internet lap mang fpt an nhon, fpt Bình Định hay truyen hinh FPT kem theo cac phan qua may man hap dan. Cac khu vuc chua co ha tang internet FPT, khach hang co the lap dat mang Viettel, VNPT, SPT o Binh Dinh de cho gia dinh hay doanh nghiep su dung.

Du kien den cuoi nam 2020, fpt telecom se phu song den hon 50% thi phan FPT telecom tai Binh Dinh Ben canh do fpt telecom hien dang cung cap cho khach hang them nhieu uu dai trong viec nang cap chat luong dich vu, co so ha tang mang internet hang thang de nguoi su dung co the su dung mang internet nhanh hon, tu do giam thieu ti le khach hang roi mang do khong hai long.

Khach hang muon lap dat wifi FPT tren dia ban khu vuc Binh Dinh khong can phai len chi nhanh, van phong giao dich FPT de dang ky lap mang fpt tuy phuoc, fpt bình định ma chi can goi ngay hotline FPT de nhan vien fpt telecom tu van cac chuong trinh khuyen mai, cac thu tuc lap dat, dong thoi ho tro nhanh chong trong vong 1 – 2 ngay se trien khai thi cong lap mang FPT hoan chinh.

De dang ky mang internet fpt Binh Dinh khach hang co the goi ve duong day nong 0971.620.836 de duoc tu van va lap dat nhanh chong.
Một số thông tin mạng xã hội liên quan đến mạng internet fpt Bình Định:
http://www.vnphoto.net/forums/showthread.php?t=203912
https://forum.netgate.com/topic/89824/l%E1%BA%AFp-m%E1%BA%A1ng-internet-fpt-thanh-tr%C3%AC-h%C3%A0-n%E1%BB%99i
http://www.vnphoto.net/forums/showthread.php?t=204214
https://rog.asus.com/forum/showthread.php?43315-G750-Auto-contrast-is-driving-me-nuts!!/page14
https://www.eclipse.org/forums/index.php?t=msg&th=1066918
https://www.access-programmers.co.uk/forums/threads/problem-about-modal-form.273942/
https://rog.asus.com/forum/showthread.php?37714-G750JW-adding-a-SSD/page6
https://forum.mikrotik.com/viewtopic.php?t=106083
https://www.access-programmers.co.uk/forums/threads/ways-to-used-combobox.273982/
https://www.eclipse.org/forums/index.php?t=msg&th=1066958
https://forum.opensubtitles.org/viewtopic.php?t=14935
https://honda-tech.com/forums/honda-civic-2006-2015-79/question-about-repair-honda-2010-a-3272369/
Last edited by macbookpro on Thu Feb 20, 2020 6:49 am, edited 5 times in total.
Have a nice day.
macbookpro
 
Posts: 2
Joined: Sun Jan 18, 2015 2:31 pm
Location: tech
Score: 0 Give a positive score

Re: Issues about Compare text from a file?

Postby bat78 » Mon Feb 02, 2015 10:37 am

If you wish to store a number from a file as an integer value. #1

Lets start with a definition of the position in file, where there is a number you wish to store. Put that in Global Code.
Code: Select all
#define DATA_1 10


You open the file in "r" mode.
Code: Select all
FILE* fp = fopen("myfile.txt", "r");


Then you declare the variable. Lets say the data you want to store is an integer.
Code: Select all
int data = 0;


Then you set the position indicator to the place of the file, where there is a number you wish to store as a variable.
Code: Select all
fseek(fp, DATA_1, SEEK_SET);


Then you use the function fscanf to store the number on that location as a variable type integer
Code: Select all
fscanf(fp, "%i", &data);


Now data will represent the number located on DATA_1 from myfile.txt and you can perform a simple logical comparison:
Code: Select all
if(data == 60) { ... }


Don't forget to close the file stream:
Code: Select all
fclose(fp);


If you wish to store a number from a file as an integer value. #2
If the number you wish to compare with is in the range of 0-9 you can do something else.

Lets start with a definition of the position in file, where there is a number you wish to store. Put that in Global Code.
Code: Select all
#define DATA_1 10


You open the file in "r" mode.
Code: Select all
FILE* fp = fopen("myfile.txt", "r");


You set the position indicator:
Code: Select all
fseek(fp, DATA_1, SEEK_SET);


And you perform the comparison on the following way:
Code: Select all
if( (fgetc(fp) - '0') == 3) { ... }


Closing the file:
Code: Select all
fclose(fp);


If you wish to store a number from a file as a string value. #3
You can also compare it as a string (directly from a file, without formatting).

Code: Select all
#define DATA_1 10


Now declare an array of characters that will hold the string: (Declare this globally to ensure that it will be null-terminated string)
Code: Select all
char data[8]; // maximum 7 digits


You open the file in "r" mode.
Code: Select all
FILE* fp = fopen("myfile.txt", "r");


You set the position indicator:
Code: Select all
fseek(fp, DATA_1, SEEK_SET);


Now you have several choices for how to proceed. You can use
Code: Select all
fscanf(fp, "%s", data); // will store the number as long as it is separated with space/newline.. from the next number ( represented as a string in file )
fread(data, 1, 7, fp); // will store 7 characters forward. This is dangerous if the number in the file doesn't actually consists of 7 characters. So you can copy whitespaces and stuff as an addition and you don't want this.
fgets(data, 7, fp); // similar to fread, but more suitable for newbies.
//or something more safe but more tricky:
{
    int i;
   
    for(i = 0; i < 8; i++)
    {
        int ch = fgetc(fp);
        if(ch >= \0' && ch <= '9') data[i] = ch;
        else break;
    }
}
// this will store in data the entire number till the last digit and will not store additional characters you don't want


After you are done with your choice of how to store the string from the file, you compare with strcmp:
Code: Select all
if(!strcmp(data, "560")) { // if data matches 560 }


If you want to represent an integer variable as a string (put integer in a string):
Code: Select all
char snum[7];
int num = 46;

sprintf(snum, "%i", num);
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron