Thread: program hangs when larger input data

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    4

    program hangs when larger input data

    here is the link to question: http://www.comp.nus.edu.sg/~cs1010/p...ex48/ilink.pdf

    below is my code:
    friendship relations #48.cppfriendship relations #48.cpp


    I have some question in regards to the b part 2.
    my code is working fine when the number of input is low. However when I input more larger input data to my program it start to hangs.

    here is the input:
    http://www.comp.nus.edu.sg/~cs1010/p...ut/friends2.in
    output:
    http://www.comp.nus.edu.sg/~cs1010/p...t/friends2.out

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by 花é¢,
    I have some question in regards to the b part 2.
    my code is working fine when the number of input is low. However when I input more larger input data to my program it start to hangs.
    Where does this problem occur? Use a debugger to find out.

    By the way, your ".cpp" file extension means that you are probably compiling the code as C++ instead of C.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. typecast array of bytes to larger data types
    By codegrush in forum C Programming
    Replies: 4
    Last Post: 03-20-2012, 11:39 PM
  2. Replies: 10
    Last Post: 01-04-2012, 06:32 AM
  3. Replies: 10
    Last Post: 09-22-2009, 11:38 AM
  4. Program hangs up at first input prompt.
    By MikeR in forum C Programming
    Replies: 3
    Last Post: 10-14-2007, 07:45 PM
  5. Possible to pack smaller data types into larger ones?
    By Heraclitus in forum C Programming
    Replies: 3
    Last Post: 02-09-2003, 03:22 PM