Couple of questions about strings and such

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shisou
    New Member
    • Jul 2007
    • 52

    #1

    Couple of questions about strings and such

    Okay, first.... is it possible to have an array that's too large? I seem to be getting an error when i try declaring a two dimentional array that's... well... huge... so i'm guessing that it is if your answer is yes...

    if it isn't possible to make it an array I'm not sure how i could do this... I'm basically trying to import a dictionary to check words. I have to check the words using a binary search so I don't think a link list would be a good choice. the other option is to compare it to each line in the file, but the problem i'm having with that is getting to specific lines in the file so any hints on that would be appreciated too...




    bottom line... i need help again :\
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    You can delare a double pointer like char**ptr and allocate memory for it in run-time.

    Raghuram

    Comment

    • Shisou
      New Member
      • Jul 2007
      • 52

      #3
      so if I did char** List then i could malloc the memory to make it like a 2-d array?

      I think that would be a great idea but it brings me to a new question...

      How would I allocate the memory for each of the pointers? Can you please give me a snip of code for that?

      Comment

      • Shisou
        New Member
        • Jul 2007
        • 52

        #4
        Originally posted by Shisou
        so if I did char** List then i could malloc the memory to make it like a 2-d array?

        I think that would be a great idea but it brings me to a new question...

        How would I allocate the memory for each of the pointers? Can you please give me a snip of code for that?
        nevermind :) i figured it out, thank you verrrrry much using the double pointer works beautifully!

        Comment

        Working...