Search:

Type: Posts; User: Ubber_C_Noob

Search: Search took 0.00 seconds.

  1. Replies
    26
    Views
    3,029

    meh, was initalizing it to 'a' cause thats how i...

    meh, was initalizing it to 'a' cause thats how i got the catalogue array thing to work

    the Catalogue Array thingy reads in a string from the kb, and uses it as the file name in the fopens()...
  2. Replies
    26
    Views
    3,029

    hey, just me again: new segfault and this one...

    hey, just me again:

    new segfault and this one aint my fault


    char *temp = malloc(sizeof(*temp)*10);
    temp[0]='a';
    scanf("%9s",temp);

    thats it, it segfaults at scanf and i dont know why.
  3. Replies
    26
    Views
    3,029

    never mind, thanx guys i fixed it, but only with...

    never mind, thanx guys i fixed it, but only with your expert help.
  4. Replies
    26
    Views
    3,029

    thats fixed the warning, does anyone have any...

    thats fixed the warning, does anyone have any idea how to fix the porblem with the segmenting?

    if i try the '&' thing infront of Catalogue in the fopen statement i get


    warning: passing arg 1...
  5. Replies
    26
    Views
    3,029

    hehe, you guys must be really getting tired of my...

    hehe, you guys must be really getting tired of my noobishness.


    char *Catalogue = malloc(sizeof(*Catalogue)*10);
    Catalogue = "a";
    printf("What file would you like to load? ");...
  6. Replies
    26
    Views
    3,029

    hey, quzah and bithub, ever consider tutoring...

    hey, quzah and bithub, ever consider tutoring first year uni students?

    i tells ya, you'ed be great at it.
  7. Replies
    26
    Views
    3,029

    i probably should have mentioned this earlier but...

    i probably should have mentioned this earlier but two of the restraints i have are,
    1. Only runtime memory is to be used.
    an
    2. You have to know what your doing.

    im pretty sure the tutors...
  8. Replies
    26
    Views
    3,029

    im really sorry that you had to type all that...

    im really sorry that you had to type all that cause i understood everything upto

    /* sizeof(temp) will typically be 4 on 32 bit systems. You probably want a value of about 19 */

    and then you...
  9. Replies
    26
    Views
    3,029

    what? remember, total programing time < 20 hours,...

    what? remember, total programing time < 20 hours, speak slo and use small words please. :p

    and wouldnt 599 slots be enough? i would have thought it would.

    and anyway, wouldnt that go wrong if i...
  10. Replies
    26
    Views
    3,029

    ok, you wanted the function ReadCatatlogue here...

    ok, you wanted the function ReadCatatlogue here it is:



    void ReadCatalogue(FILE *myfile)
    {
    char*loadedfile=(char*)malloc(sizeof(char*)*600);
    char*temp =...
  11. Replies
    26
    Views
    3,029

    ok heres the new porblem. char*Catalogue =...

    ok heres the new porblem.


    char*Catalogue = (char*)malloc(sizeof(char*)*10);
    scanf("%s",&Catalogue);
    if((myfile = fopen(&Catalogue,"r+"))==NULL)
    {
    printf("\nFile could not be loaded.\n");...
  12. Replies
    26
    Views
    3,029

    the above post is no longer valid, ive change the...

    the above post is no longer valid, ive change the code soo much.
  13. Replies
    26
    Views
    3,029

    ok, i chagnged it so that you dont get the...

    ok, i chagnged it so that you dont get the compare string in the main function, but in the ReadCatalouge function, thus reducing the amount of things being passed to ReadCatalogue.

    segementation...
  14. Replies
    26
    Views
    3,029

    nope soz dude that didnt help at all, still...

    nope soz dude that didnt help at all, still segmenting. :(
  15. Replies
    26
    Views
    3,029

    Segmentation faults out the ****

    i have the following:



    myfile=fopen("getlin.txt","r+");
    char*compare=(char*)malloc(sizeof(char*)*20);
    int*choice=(int*)malloc(sizeof(int*)*2);
    scanf("%d",choice);
    printf("\nWhat would you...
Results 1 to 15 of 15