Search:

Type: Posts; User: Taka

Page 1 of 6 1 2 3 4

Search: Search took 0.01 seconds.

  1. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    I've tried as below but get the following compile...

    I've tried as below but get the following compile errors:

    main3.cpp:11: error: ISO C++ forbids declaration of 'parameter' with no type
    main3.cpp: In function 'void checkWords(int, char**)':...
  2. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    But how? I'm sorry it's been a long day and I'm...

    But how? I'm sorry it's been a long day and I'm not sure what I'm doing.
  3. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    Ok I get that, but how do I call uniqueWords,...

    Ok I get that, but how do I call uniqueWords, totalWords and tree inside the printWords from checkWords?
  4. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    So the below code now runs, the problem is that...

    So the below code now runs, the problem is that where it was outputting and calculating originally it no longer does. Can anyone see why/help me with why please?



    #include <iostream>
    #include...
  5. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    I'm not sure how to do that in this case sorry.

    I'm not sure how to do that in this case sorry.
  6. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    I'm not allowed to use global variables so how...

    I'm not allowed to use global variables so how else could I do this?
  7. Thread: Help with code.

    by Taka
    Replies
    10
    Views
    1,237

    Help with code.

    int main( int argc, char *argv[] )
    {

    ==> This function has over 60 lines.
    You need to split it into smaller functions


    Everytime I try to split it up I just cause errors (it compiles...
  8. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    I'm sorry I'm trying to understand what you're...

    I'm sorry I'm trying to understand what you're saying and trying to get it to work but I'm not understanding. Sorry.
  9. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    So I've edited the code and it compiles but when...

    So I've edited the code and it compiles but when I run it I get the below error:

    ./a.out 32
    10000 Items in vector
    Sorting vector using shell sort
    Segmentation Fault (core dumped)

    Any ideas...
  10. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    How else would I do it? I thought the boolean...

    How else would I do it? I thought the boolean would be a good way.
  11. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    Isn't the passes my count though? bool...

    Isn't the passes my count though?



    bool Changed = true;
    int Passes = 0;
    while(Changed)
    {
    if Changed = false;
    passes++;
  12. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    Ok yeah I think you're right. So in that case I...

    Ok yeah I think you're right. So in that case I would just remove the swap function from the check right?



    bool Changed = true;
    int Passes = 0;
    while(Changed)
    {
    if Changed = false;...
  13. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    Would something like the below do the job...

    Would something like the below do the job properlly?

    Its just the raw so I'd have to edit to fit it to the spec but I'm just trying to work out the logic first.



    bool Changed = true;
    int...
  14. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    template int...

    template <class iterator>
    int sortPercentage(iterator start, iterator finish);



    Would the above be better?
  15. Thread: Sort Function

    by Taka
    Replies
    16
    Views
    2,827

    Sort Function

    Hey,

    Can anyone help me with the development of the below sortPercentage function?



    #include <stdlib.h>

    #include <iostream>
    #include <algorithm>
  16. Thread: Data Type Errors

    by Taka
    Replies
    8
    Views
    1,891

    Data Type Errors

    Can anyone help with the below compiling errors please?

    hash.cpp: In function 'int main()':
    hash.cpp:51: error: invalid conversion from 'data*' to 'int'
    hash.cpp:51: error: initializing...
  17. Replies
    2
    Views
    2,623

    Worked it out. Should've used return not break...

    Worked it out. Should've used return not break and my count was in the wrong place.

    Thanks.
  18. Replies
    2
    Views
    2,623

    Linear Search Problem

    Hi, If anyone could help me with where I've gone wrong with the linear search below it would be greatly appreciated.



    #include <iostream>
    #include <vector>

    using namespace std;

    void...
  19. Replies
    3
    Views
    1,065

    Thanks for your help. How would you...

    Thanks for your help.



    How would you suggest I approach it then and where would I begin changing things to make it better??

    I've changed it as below but now when I run tests on it it comes...
  20. Replies
    3
    Views
    1,065

    Code Restructure Help

    ==> class MessageAssembler { This function has over 60 lines. You need to split it into smaller functions
    ==> At least one function in your code must use 'call by reference'. You do not appear to...
  21. Replies
    5
    Views
    3,853

    Converting from C to C++

    Hey guys. I have the below code in C but I need to convert it to C++, any ideas about where to start and what would need to change majorly would be appreciated.



    #include<stdio.h>...
  22. Thread: Logic Error Help

    by Taka
    Replies
    4
    Views
    1,518

    I didn;t intentionally I just missed it for some...

    I didn;t intentionally I just missed it for some stupid reason.

    Thanks for your help.
  23. Thread: Logic Error Help

    by Taka
    Replies
    4
    Views
    1,518

    Is that because of the declare at the start of...

    Is that because of the declare at the start of the function or somewhere else?
  24. Thread: Logic Error Help

    by Taka
    Replies
    4
    Views
    1,518

    Logic Error Help

    I'm trying to sort the below by last name from A -> Z but I can't get it to sort and I'm not sure where I've buggered it. I've tried desk checking it but it all looks ok to me. Any ideas would be...
  25. Replies
    3
    Views
    8,889

    And I'm an idiot. Thanks.

    And I'm an idiot.

    Thanks.
Results 1 to 25 of 128
Page 1 of 6 1 2 3 4