Search:

Type: Posts; User: killpoppop

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    12
    Views
    1,432

    On playing around with the code it now seems to...

    On playing around with the code it now seems to make more sense.




    for ( l=0; l < na + nb ; l++)
    {
    A[l] = C[l] ;
    printf ( "%d ", A[l] ) ;
    }
  2. Replies
    12
    Views
    1,432

    Works perfectly thank you! Just one more little...

    Works perfectly thank you! Just one more little question to do with the print out of A.

    Sample Input:
    4
    3
    2
    1
    Sample Output:
    1st Line: 3421 Still dont get...
  3. Replies
    12
    Views
    1,432

    Ahh yes, makes sense. Thanks =] ...

    Ahh yes, makes sense. Thanks =]




    #include<stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ctype.h>
  4. Replies
    12
    Views
    1,432

    First of all thanks a lot for the great reply,...

    First of all thanks a lot for the great reply, thought i'd try and tackle it now rather than in the morning! Made all the changers. Points 2 and 3 make perfect sense to me, a little unsure about 1...
  5. Replies
    12
    Views
    1,432

    Moved straight on to the next sort. Tried to put...

    Moved straight on to the next sort. Tried to put together a merge sort. Got the merge function working well, but once again its not recursive. So given the input '4' '3' '2' '1'. It splits it in two...
  6. Replies
    12
    Views
    1,432

    Yep. Nailed it. Thank you so much, can't believe...

    Yep. Nailed it. Thank you so much, can't believe I didn't think of that. Spent ages isolating the problem to those lines! But makes perfect sense, without the return the recursive calls do nothing....
  7. Replies
    12
    Views
    1,432

    Sorry =] Right everything goes in fine into...

    Sorry =]

    Right everything goes in fine into the search function. That is the array of numbers, the lowest index of the array '0', the highest index of the array and the value im trying to find in...
  8. Replies
    12
    Views
    1,432

    Binary Search Help!

    Hi people. Been doing some revision for an exam I have in a few months. To get a better idea i've been coding some search and sort algorithms. I have stumbled across a bug with my binary search and...
  9. Replies
    36
    Views
    4,165

    Yep i got your code just never came across...

    Yep i got your code just never came across isalpha before, its awesome. I just misread '\'' as " \ " as my text editor puts apostrophe's extremely close together.

    Thanks for all the help =]
  10. Replies
    36
    Views
    4,165

    Thanks a lot laserlight. So if i want to use...

    Thanks a lot laserlight. So if i want to use dynamic memory allocation i do it elsewhere rather than in the read function?

    Also could you explain
    ( isalpha( z ) || z == '-' || z == '\'' )quickly...
  11. Replies
    36
    Views
    4,165

    Right can you explain this very briefly, i'm new...

    Right can you explain this very briefly, i'm new to the language and understand it is an issue with memory. But as far as i can see no word is larger than 30 characters. But i'm obvious not on your...
  12. Replies
    36
    Views
    4,165

    The Battle of Dien Bien Phu was the climactic...

    The Battle of Dien Bien Phu was the climactic battle of the First Indochina War between French Union forces and Viet Minh communist revolutionary forces. The battle occurred between March and May...
  13. Replies
    36
    Views
    4,165

    #include #include #include...

    #include <stdio.h>
    #include<string.h>
    #include <stdlib.h>
    #include<ctype.h>

    char read( FILE *text )
    {
    int i = 0 ;
    char z, *temp ;
    temp = calloc( 30, sizeof( char ) ) ;
  14. Replies
    36
    Views
    4,165

    To laserlight. So you believe the problem with...

    To laserlight.

    So you believe the problem with realloc is that there is a word bigger than 30 in the text document?

    Or should i realloc is another location?
  15. Replies
    36
    Views
    4,165

    And as far as other code there isn't much else...

    And as far as other code there isn't much else that could cause a problem.
  16. Replies
    36
    Views
    4,165

    I'm currently running it on windows i'll hop over...

    I'm currently running it on windows i'll hop over to gdb on ubuntu. All i get while running the program is a pop up that just says 'book.exe has stopped working' .
  17. Replies
    36
    Views
    4,165

    I get what your saying although hopefully that...

    I get what your saying although hopefully that wont be in the text document =] I just don't quite how i would implement your suggestion. So i would watch the value of i? Once it hits 30 double the...
  18. Replies
    36
    Views
    4,165

    I get you completely but say if i make temp 50....

    I get you completely but say if i make temp 50. There won't be any words past that capacity surely?

    Also can i take whatever is in the else statement and put it outside with it still being in the...
  19. Replies
    36
    Views
    4,165

    I tried changing both cases. The first which has...

    I tried changing both cases. The first which has (i+1) and the second which has the plus one after.
    In reply to your question, there could be a word longer than 30 characters?
  20. Replies
    36
    Views
    4,165

    MK27 i have tried yours. It compiles fine like...

    MK27 i have tried yours. It compiles fine like the other tries. But once again crashes while its printing out.
  21. Replies
    36
    Views
    4,165

    I've tried that =[ It causes my program to crash...

    I've tried that =[ It causes my program to crash even sooner than before. With just 'i' it manages 100 words of so then crashes. (i+1) it can only do one word.
  22. Replies
    36
    Views
    4,165

    Although using 'i' would be smart can i just use...

    Although using 'i' would be smart can i just use 1?
  23. Replies
    36
    Views
    4,165

    char read( FILE *text ) { int i = 0 ; char z...

    char read( FILE *text )
    {
    int i = 0 ;
    char z ;
    char *temp ;
    temp = calloc( 30, sizeof( char ) ) ;
    /* Reads in the words one at a time to an array */
    while( ( z = fgetc( text ) ) != EOF...
  24. Replies
    36
    Views
    4,165

    Um like if i replace 'i' with say 20 it does it...

    Um like if i replace 'i' with say 20 it does it fine. Even if i change it to 5 it still takes words bigger than 5 ( does that mean its not working or how realloc works? ) whenever i use 'i' it...
  25. Replies
    36
    Views
    4,165

    Realloc Quick Question.

    Right i've allocated space in memory for.


    temp = calloc( 30, sizeof( char ) ) ;

    This array then gets thrown into a list and another word put into it, then into the list etc. What i'm trying...
Results 1 to 25 of 44
Page 1 of 2 1 2