Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6917313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:42:53+00:00 2026-05-27T09:42:53+00:00

I have the following code: void readFile(BST *tree) { ifstream infile(input.txt); long int sid,

  • 0

I have the following code:

void readFile(BST *tree) {
    ifstream infile("input.txt");
    long int sid, t;
    string l, f, h;
    while (infile >> sid >> l >> f >> h >> t) {
    // The line below is for debug purposes
    cout << "\"" << sid << "\" \"" << l << "\" \"" << f << "\" \"" << h << "\" \"" << t << "\"" << endl;
        tree->insert(sid, l, f, h, t);
    }
    infile.close();
}

Here is an example line:

78832112 Bruno Nicholas 32_Sugar_Rd_PA_12345 3026821712

Interestingly my code doesn’t read anything from this line. Even more interesting is that if I remove any digit from the last number it reads it just fine.

I have no idea what causes this behavior. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:42:54+00:00Added an answer on May 27, 2026 at 9:42 am

    Well, the number is too big for your platform’s long… you can either use uint64_t or something like that to give your program more breathing space, and/or you have to document your file format and the restriction on the valid ranges of values that your format can support.

    Never forget that programming is only one half of I/O. The other half is the documentation. I/O is nothing without a format specification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& ioCounterStats, std::map
I have the following code: public void DrawLetter(int Cell, string Letter, int X, int
I have the following code: public void post(String message) { final String mess =
I have following code public class TEST { public static void main(String arg[]){ try
i have the following code: public static void Serialize() { List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
i have following pseudo code : void siftup(int n) pre condition n>0 && heap(1,n-1)
I Have the following code: -(void) changeAnimation:(NSString*)name forTime:(int) times { if(currentAnimation != @attack) {
I have the following code: void Foo() { static std::vector<int>(3); // Vector object is
I have the following code -(void) animate:(UIButton*) b withState: (int) state andLastState:(int) last_state {
Currently I have The following code: void Page_Load(object sender, System.EventArgs e) { string connectionString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.