CrazyEngineers
  • Which language to use

    Pensu

    Member

    Updated: Oct 26, 2024
    Views: 1.5K
    Hi ppl,

    I am coding a program and in that i have to handle a very large amount of data. It can vary from 1 to 1000000000. I am using "C" and "unsigned long int" data type, but my program hangs every time i try to run it over 1000000. Any suggestions???
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • PraveenKumar Purushothaman

    MemberJun 26, 2011

    Why don't you try C#.NET 2008 and use BLOB format?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberJun 26, 2011

    @praveenscience: will try that...thnks..😀
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 26, 2011

    I said C# because, it is kind of Platform Independent. Mono for Linux and Mac... 😀 And you can use your own C / C++ Codes to work on it... 😀 And, BTW, what is the logic you are trying to implement? I mean, I didn't understand your problem... 😔
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberJun 27, 2011

    Basically i have been given a task to find out primes in the range of 1 to 1000000000. So i made the code but my program hangs as soon as i input data greater than 1000000. So i thought may be its the problem with data type.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 27, 2011

    Yeah, first of all data type should be some kinda looong integer... and secondly, C doesn't have that much memory to handle the data... 😔
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberJun 27, 2011

    Yeah.....its looks like that. And can you please elaborate the part with memory. Whats this memory restriction???
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 27, 2011

    Dude, C Applications are 16 bit apps, which cannot handle more than 16bit of instruction and data... Whereas C# is a 32 bit application and it can handle much higher data... 😀 Got it?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberJun 27, 2011

    Hmm......thanks...😀
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 27, 2011

    You are welcome... 😀
    Are you sure? This action cannot be undone.
    Cancel
  • rubensg

    MemberJun 27, 2011

    Well, you can pretty much do the same function on C just with a different approach. If you machine has multiple cores, you can program in threads so that you make them run on different processing units concurrently. I think that would be enough to handle the amount of data you are going to feed it.

    In case that would not be enough, C# would be there to do it for you.
    Are you sure? This action cannot be undone.
    Cancel
  • PraveenKumar Purushothaman

    MemberJun 27, 2011

    Actually, that doesn't work in C. Since, DOS works only in a single thread model, C too does the same! 😔
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register