#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    How do i make my one of my arrays equal the length of another


    hi i have another question


    okay i have one array1 that has a size array1[10] but this array stores a word from a file so every time a word gets stored its different size so the location of the null character is different



    and i want my second array to equal the amount up to the null character of the first array

    so something like

    array2[sizeuptonullcharacterofarray1];
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Use malloc() or strdup(). Don't forget to call free() when you're done with it.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0
    Originally Posted by Scorpions4ever
    Use malloc() or strdup(). Don't forget to call free() when you're done with it.
    um how do i do this im not familiar with these terms

IMN logo majestic logo threadwatch logo seochat tools logo