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**)':...
Type: Posts; User: Taka
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**)':...
But how? I'm sorry it's been a long day and I'm not sure what I'm doing.
Ok I get that, but how do I call uniqueWords, totalWords and tree inside the printWords from checkWords?
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...
I'm not sure how to do that in this case sorry.
I'm not allowed to use global variables so how else could I do this?
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...
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.
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...
How else would I do it? I thought the boolean would be a good way.
Isn't the passes my count though?
bool Changed = true;
int Passes = 0;
while(Changed)
{
if Changed = false;
passes++;
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;...
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...
template <class iterator>
int sortPercentage(iterator start, iterator finish);
Would the above be better?
Hey,
Can anyone help me with the development of the below sortPercentage function?
#include <stdlib.h>
#include <iostream>
#include <algorithm>
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...
Worked it out. Should've used return not break and my count was in the wrong place.
Thanks.
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...
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...
==> 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...
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>...
I didn;t intentionally I just missed it for some stupid reason.
Thanks for your help.
Is that because of the declare at the start of the function or somewhere else?
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...
And I'm an idiot.
Thanks.