Search:

Type: Posts; User: Alexander

Search: Search took 0.00 seconds.

  1. Replies
    52
    Views
    10,715

    char string[256]; char string =...

    char string[256];
    char string = malloc(sizeof(int) * 256);

    So, these are essentially the same thing right?
  2. Hey, whatever inspires him to learn, right? :p

    Hey, whatever inspires him to learn, right? :p
  3. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Ah ok, so it's really more of a last resort?

    Ah ok, so it's really more of a last resort?
  4. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Oh jeez, yeah, you're right. I got myself...

    Oh jeez, yeah, you're right. I got myself confused. xD I thought he meant to find the sum of all the numbers between 0 and the entered number because that's what he did last chapter. ^^;
  5. Replies
    52
    Views
    10,715

    Lol well it helped a bunch. It was a great...

    Lol well it helped a bunch. It was a great analogy. Thanks. :)
  6. Replies
    52
    Views
    10,715

    Huh.. Weird.. I think I get it now.. ^^; Was...

    Huh.. Weird.. I think I get it now.. ^^;
    Was this pre-written somewhere? Because this odd explanation actually helped a lot for some reason if this is all true. xD

    *bookmarks*
  7. Replies
    52
    Views
    10,715

    So according to that code, I can't just do this?...

    So according to that code, I can't just do this?


    int* pNums = malloc( sizeof(int) ); /* An array of 1 int. */
    pNums[0] = 5;
    pNums[1] = 10;
    pNums[2] = 666;

    So I do have to add the realloc?...
  8. Replies
    52
    Views
    10,715

    So wait, how can I continue to put more data in...

    So wait, how can I continue to put more data in that variable then?
  9. Replies
    52
    Views
    10,715

    So if it's different from int, and double type...

    So if it's different from int, and double type things, how do I put data into it then? Is it different?
  10. Replies
    52
    Views
    10,715

    Ah ok. I get most of that. I don't know much...

    Ah ok. I get most of that. I don't know much about "the heap" I guess then. So it's like higher priority global memory or something?

    (lol'd at the double d)
  11. Replies
    52
    Views
    10,715

    So, it makes a dynamic array type thing? o.o

    So, it makes a dynamic array type thing? o.o
  12. Replies
    52
    Views
    10,715

    Well to be honest, I don't really know what the...

    Well to be honest, I don't really know what the memory the is allocated by malloc and such is used for. I'm that far behind. Do I put variables in it or something? Because isn't that what the "int"...
  13. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    xD So it's pretty much just ugly coding? Well,...

    xD So it's pretty much just ugly coding? Well, I'll try and pretend it doesn't exist then. I don't think I'll need to use it quite yet any ways. Thanks.
  14. Replies
    52
    Views
    10,715

    Ok, I'm still confused. How do I know when I need...

    Ok, I'm still confused. How do I know when I need to use these functions? Is there any sort of output that will allow me to see what these are doing and such.

    Sorry. I'm often a visual learner, so...
  15. Replies
    52
    Views
    10,715

    Memory Functions - Still Learning

    I just don't get these at all:
    malloc()
    free()
    realloc()
    calloc()

    I think I'm having a hard time grasping the point in what these are for.

    I'm reading this tutorial by beej. Here.
    And I...
  16. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Ok, will do. Is there any particular reason? Is...

    Ok, will do. Is there any particular reason? Is it resource consuming or something?
  17. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Oooh, I like the goto statement. Is there a...

    Oooh, I like the goto statement. Is there a drawback to it though?
  18. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Hmm, yeah. I didn't want to do that, I know how...

    Hmm, yeah. I didn't want to do that, I know how to do functions, but my tutorial hadn't gotten to them yet, so I thought I'd do it with out that and do it with what they have taught me so far.
  19. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Oh! Now I get what you mean! #include...

    Oh! Now I get what you mean!


    #include <stdio.h>

    int main(void){

    int x, z = 0; //variables

    while(x>0){ //check user input
  20. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Yeah, but then it stops. How should I make the...

    Yeah, but then it stops. How should I make the program restart again preferably?
  21. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Gah! I'm retarded. I forgot the address part....

    Gah! I'm retarded. I forgot the address part. Sorry. ^^; Thanks for that. And what do you mean by having to enclose the scanf() in a while loop? o.o I didn't know I had to do that. And I want the...
  22. Thread: Learning C

    by Alexander
    Replies
    35
    Views
    3,853

    Learning C

    Ok, I'm kind of confused. I swore I understood what I was doing a second ago. xD
    I'm trying to learn C and failing apparently. My tutorial gave me this assignment:



    So, I thought that it would...
Results 1 to 22 of 22