New pointer locations

This is a discussion on New pointer locations within the C Programming forums, part of the General Programming Boards category; Hey everyone I am new to this board and to C. Alright I have a programming assignment doing analytics on ...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    1

    New pointer locations

    Hey everyone I am new to this board and to C.

    Alright I have a programming assignment doing analytics on text files. This problem is driving me crazy. Ok I have array of a structure to store the string and the number of occurrences that it appears in the text file. PROBLEM: While in the main loop of storing data in the array of structures i need to get a new memory location to store the string. It keeps writing over the memory location. I know why it is doing it, but i do not know how to work around this problem without making a huge array. efficiency is necessary

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Show us your code!
    None of us is a mind reader...

    << !! Posting Code? Read this First !! >>

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,047
    Sounds like a static array implementation; dynamically allocate arrays with malloc() instead.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer to a function pointer
    By @nthony in forum C Programming
    Replies: 3
    Last Post: 05-30-2010, 06:13 PM
  2. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 11:10 AM
  3. Quick Pointer Question
    By gwarf420 in forum C Programming
    Replies: 15
    Last Post: 06-01-2008, 04:47 PM
  4. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 04:36 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21