Results 1 to 12 of 12

Thread: C/C++ file?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Get a Mac moridinbg's Avatar
    Join Date: Dec:2004
    Location: 0x00000000
    Posts: 4,211

    C/C++ file?

    file? , /rw, r+, etc./ string , . "The brown fox" "quick ", "The " "The quick fox". Insert Word/Excel... "The quick brown fox"...
    ? brown , quick brown . . - ?
    ++ .

  2. #2
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    . , "replace", "insert". - . . "" , shift- .

  3. #3
    Get a Mac moridinbg's Avatar
    Join Date: Dec:2004
    Location: 0x00000000
    Posts: 4,211
    . .

  4. #4
    XaMaB's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 20,387
    E . . .
    : XaMaB; . 0.42

    In God we Trust (all others must submit a X.509 certificate). , ()

  5. #5
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    SetField , , . google - .

  6. #6
    Get a Mac moridinbg's Avatar
    Join Date: Dec:2004
    Location: 0x00000000
    Posts: 4,211
    , .

    string file, ? malloc-, . - char sRead[5000] , , 5000 , .
    string malloc(sizeof((char)*LettersNumber)), . a fscanf_s ? fscanf_s(File,"%s",char sTemp[]);
    Last edited by moridinbg; 5th January 2007 at 18:02.

  7. #7
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    Quote Originally Posted by moridinbg View Post
    , .

    string file, ? malloc-, . - char sRead[5000] , , 5000 , .
    string malloc(sizeof((char)*LettersNumber)), . a fscanf_s ? fscanf_s(File,"%s",char sTemp[]);
    C++ , ...

    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    
    ...
    
    ifstream fi("TheFileIWantToRead.txt");
    string temp;
    while (fi >> temp) { /* Do stuff */ }
    ...
    C++- string .
    Last edited by anrieff; 5th January 2007 at 18:20. Reason:
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  8. #8
    Get a Mac moridinbg's Avatar
    Join Date: Dec:2004
    Location: 0x00000000
    Posts: 4,211
    . /++. ++ .
    ,

    1. .
    2. . .
    3. .
    4. sizeof(char)*( +1) //+1 /0
    5. , .
    6. , ,

  9. #9
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    moridinbg, , , - . ...

    1. , fseek()- ftell() ;
    2. ;
    3. rewind()- ;
    4. fread();
    5. parse- ( )

    , ,
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  10. #10
    Get a Mac moridinbg's Avatar
    Join Date: Dec:2004
    Location: 0x00000000
    Posts: 4,211
    , , file 1-2MB? ...

  11. #11
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  12. #12
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    - C++ iostreams. - memory-mapped files. Bombera low-level API- , - , Boost.Interprocess.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |