Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: zanza
  • Order by date
  1. zanza

    malloc() returning null for no reason

    i was wondering about that earlier last night when i started writing this... hehe. thank you salem. :)
  2. zanza

    malloc() returning null for no reason

    well, im glad it worked despite my lack of error checking. :) but, thats not the troublesome part of the code. first though, i updated one small error i found in the version i first posted... the link above contains the updated source. if(room[i].numberofDialogs) { room[i].dialog =...
  3. zanza

    malloc() returning null for no reason

    ftp://tricks:tricks@67.18.198.26/patrick/engine.zip the malloc on line 86 of nav.c returns null while, not only is its parameter valid, but, i also use the exact same implementation nearer the top of the file. --- for any of you who might keep track... yeah, i revived my oldest project again...
  4. zanza

    being self taught leaves too many holes...

    hmm... does loading myself into a trebuchet count as a kick? ^_- well, i suppose it doesnt help that i seem to only want to code when im sleepy. but being 17 and self taught isnt friendly either. oh well, expernience comes through errors... but only if you listen to those who correct them. ^^...
  5. zanza

    being self taught leaves too many holes...

    so the topic is dynamic allocation. this is the struct im working with typedef struct { int RegionCount, NameLength; char *name; struct { int TownCount, NameLength; char *name; }*region; }*world; and this is the code that uses it world gia = (world)...
  6. zanza

    enum's... convinient, but used too often?

    :) well thats good to hear. ive started a project in which i already have three enums that average 12 symbols. its so much easier with them, but you know what they say about too much of a good thing. *shrug* thanks for your reply. žÅNžÅ
  7. zanza

    enum's... convinient, but used too often?

    enum's are very nice, they make organizing and indexing into complicated arrays painless, and they make the code a little more logical for other readers. but what im curious about is: what would any of you say would be considered using too many enumerators? žÅNžÅ
  8. zanza

    using qsort() on a dynamically allocated 2d array

    so ka. danke. :) that entire faq is very useful, ill be sure to read it. žÅNžÅ
  9. zanza

    using qsort() on a dynamically allocated 2d array

    alright, i changed the string/pointer allocation, and it still doesnt work. once more, ive uploaded the up to date source (see above). and, once more, the allocation works, but qsort isnt. žÅNžÅ
  10. zanza

    using qsort() on a dynamically allocated 2d array

    ... *smacks his own forehead* nevermind that entire post... i misunderstood you salem. let me try that. :) žÅNžÅ
  11. zanza

    using qsort() on a dynamically allocated 2d array

    my apologies, i apparently mistyped or miscopied my own code. -_- sort[ct] = (char *) malloc((sizeof(char)*lot+1)); is the actual line that im using, and that indeed works. when i finished that part of the code, i made sure it worked just as you said, salem (with the for loop). but, as i said...
  12. zanza

    using qsort() on a dynamically allocated 2d array

    i place the polynomial in a string, and then split it up into its respective terms thusly... char **sort; int los = 0, i = 0, not = 0, lot = 0, ct = 0, lopt = 0; ... //(after having counted the number of terms)... sort = (char **) malloc((sizeof(char)*not)); for(i = 0; i < los; i++) //loop to...
  13. zanza

    using qsort() on a dynamically allocated 2d array

    so, we want our polynomials in the "proper" order (descending exponents) right? of course. :) or so my algebra 2 book says. *shrug* anyway, to do that i have a dynamically alloced 2d array holding each of the terms of the polynomial as a character string. currently, im attempting this to sort...
  14. zanza

    C Boolean logic... not being very logical

    can someone explain to me why these two statements are different? while(!(choice=='u'||choice=='U'||choice=='d'||choice=='D')) while(choice!='u'||choice!='U'||choice!='d'||choice!='D') sorry to be asking such a moronic question, but i swear ive used similar statements to the second one before...
  15. zanza

    max allocatable size for malloc()?

    so ka... thank you salem (and everyone else who posted). on a side note, i wont be doing any real encryption with this. im just learning for fun. but thank you for the text: tis always welcome. ^_^ >There is simply no need for allocating such large blocks of data. i know, i know! :) wie ich...
  16. zanza

    max allocatable size for malloc()?

    sandup: if you can call that clever, yeah. thats what i did. :) and ion: yeah, i know how i could actually use a 4 gig key, but i dont really want to do that right now, it was just a funny idea. at this point (as suggested by the subject of this post) im just curious about the functional limits...
  17. zanza

    max allocatable size for malloc()?

    i know that. but it has lots to do with dynamically allocated strings. :P žÅNžÅ
  18. zanza

    max allocatable size for malloc()?

    i did figure out that size_t was a 32bit int, and system memory+swap space was one of my guesses. but as to why exactly i was trying to do that... im learning about xor encryption, and i just wanted an app that would generate me a random key of whatever length i asked. so, me being me, i want...
  19. zanza

    max allocatable size for malloc()?

    does anyone know what the maximum amount of memory malloc() can pull is? i know it fails when i go up to and past a gig. i have 384 megs of system memory and my page file is maxed out at 512 megs. also, just because im already writing and youre already reading... ^_- when i ask malloc to do...
  20. zanza

    better way to do it?

    *nods* i think im still learning C, so the majority of the applications i write are just for fun. but even still, when i consider myself good enough at the language to be able to teach it, writing programs just to solve an inconsequential problem is half the fun of having this skil. :) žÅNžÅ

Part and Inventory Search

Back
Top