KYA's Profile User Rating: *****

Reputation: 3145 Guru
Group:
Alumni
Active Posts:
19,332 (6.88 per day)
Joined:
14-September 07
Profile Views:
143,059
Last Active:
User is offline Today, 09:43 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
AMD
Favorite Gaming Platform:
PC
Your Car:
Honda
Dream Kudos:
3300
Expert In:
C, C++, Java

Latest Visitors

Icon   KYA likes Ruby

Posts I've Made

  1. In Topic: Reading/Writing to a specific line in a text file

    Posted 27 May 2015

    Assuming you're reading the entire file and you know the structure then an increment isn't really necessary. Just loop until input returns EOF and assign as you go.
  2. In Topic: Reading/Writing to a specific line in a text file

    Posted 27 May 2015

    Each time you read a line, you increment. So, for example if you know you need the value at line 5:

    int line = 1;
    while (line <= 5){
      file >> input;
      line++;
    }
    //now do something with the value at line five
    
    


    The better way to do this is to read the entire file in at startup and put into some objects you've created that represent the data. UserName/Login, etc...

    Then you just reference those and don't worry about placement in the file anymore.
  3. In Topic: Reading/Writing to a specific line in a text file

    Posted 27 May 2015

    Why not?

    The filename parameter constructor calls open() internally.
  4. In Topic: Reading/Writing to a specific line in a text file

    Posted 27 May 2015

    Since your file will have a specific format, you can use the >> operator and keep a counter:

    ...
    fstream file;
    file.open("yourfile");
    string input;
    int line = 1;
    while(file >> input){
      //do stuff
      //use line number here to break out or as a sentinel value for the loop
    }
    
    
    


    getline() is also an option
  5. In Topic: What ya drinkin, eh?

    Posted 19 May 2015

    Canadian spotted!

    Monster Khaos. It used to be more % of juice, but it is amazing. "Ripper" is okay, it's more of a tropical flavor but even less juice than Khaos.

    Or coffee with cream. Dunkin Donuts preferred.

My Information

Member Title:
g++ jameson.cpp -o beverage
Age:
27 years old
Birthday:
February 8, 1988
Gender:
Location:
U.S.
Full Name:
Knowles Y. Atchison, Jr.
Years Programming:
7
Programming Languages:
C, C++, Java (Experienced)
Ruby, Lua

Contact Information

E-mail:
Private
Website URL:
Website URL  http://knowlesatchison.net
LinkedIn:
http://www.linkedin.com/in/knowlesatchison
Twitter:
_KYA

Comments

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  1. Photo

    mireille4U Icon

    30 Apr 2015 - 05:23
    Greeting from mireille i saw your profile today and i became interested in you and i will like to know more about you and if you can mail an email to my mail address (mireille4u@live.com) i will give you my picture.here is my mail address i hope we can move from here.above. Mireille
  2. Photo

    Michael26 Icon

    25 Jun 2013 - 15:43
    Reputation: 3000
    Nice round number :)
  3. Photo

    Highdrox Icon

    05 Apr 2013 - 07:37
    Hello,
    Our community Digital Dominance is preparing to launch, we do have 1 coder right now but are looking for another coder to join and help produce cheats for the MultiPlayer Game Hacking community.
    There is potential to make some good money and build a name as a coder.
    If you are interested please contact me.
    Thanks,
    Highdrox@live.ca
  4. Photo

    Martyr2 Icon

    23 Sep 2012 - 14:15
    Thanks for the five year badge, much appreciated. :)
  5. Photo

    lbrownlbandit Icon

    13 Jun 2012 - 12:40
    Hi , just wondering I could borrow you black jack code http://www.dreamincode.net/forums/topic/75554-blackjack-game/
  6. Photo

    strawhat89 Icon

    12 Jun 2012 - 22:40
    I see you like witty quotes. Have you read Jim Butcher's Dresden Files? Its chock full of witty banter.
  7. Photo

    strawhat89 Icon

    12 Jun 2012 - 22:40
    I see you like witty quotes. Have you read Jim Butcher's Dresden Files? Its chock full of witty banter.
  8. Photo

    no2pencil Icon

    21 Feb 2012 - 19:29
    Ich habe eine Koch-Video!
  9. Photo

    blutrane Icon

    13 Feb 2012 - 07:52
    Wo ist der neue Koch-Video?
  10. Photo

    Guest 

    04 Sep 2011 - 07:58
    Hello, with the pudding. Pudd-pudd-pudd-pudd-pudding! Hello, with pudding. Pudding Bill Cosby. PUDDING! Bill Cosby. PUDDING! Bill Cosby. PUDDING! Bill Cosby. Pudding, pudding, pudding, pudding.
    .
    .
    .
    .
    .
    .
    .
  11. Photo

    Shahrzzad Icon

    14 Jul 2011 - 09:29
    Thank u so much for accepting my friend request.:).
    Best.
    Shahrzad.
  12. Photo

    y2161994 Icon

    13 Jul 2011 - 03:23
    Hey friend,can you tell how I can know that My tutorial is approved or not.
  13. Photo

    ishkabible Icon

    28 Jun 2011 - 17:07
    get out of my BIOS, you could corrupt the input...or worse...the output!!
  14. Photo

    no2pencil Icon

    21 Jun 2011 - 11:27
    Post another baby making/cooking video!
  15. Photo

    Sergio Tapia Icon

    23 May 2011 - 20:27
    Post another cooking video!
  • (3 Pages)
  • +
  • 1
  • 2
  • 3