Thanks buddy.
Type: Posts; User: kromozom
Thanks buddy.
enum {HASH_TABLE_SIZE = 101};
typedef ChainNode * HashTableType[HASH_TABLE_SIZE];
I could not get the point, can someone explain what 2nd line of the code does to me?
Best wishes
I got it now, it works.
First declaration worked. I didn't include the header file, just declaration and a pointer did everything working well.
Thank you Darryl.
Hi Darryl,
I got what you mean and it is a brilliant idea.
However, I cannot add the #include "realBST.h" into "realTreeNode.h" and therefore, I cannot even create a pointer to BinarySearchTree...
Hi all,
I have a header file "realTreeNode.h" and starts like this;
#ifndef REALTREENODE_H
#define REALTREENODE_H
#include "keyedItem.h"
It does compile without any error when you do not create an instance of a class. However, when you try to create an object, it gives error such as;
d:\directory\driver.cpp(10): error C2065:...
Hello everybody,
I have some files both .cpp and .h that are coded in C++ by someone else before(only 5 files that creates a Binary Search Tree). I would like to use it in my project.
First of...
Hi, I have a simple code.
#include "stdafx.h"
#include <iostream>
using namespace std;
#include <cstdlib>
#include <ctime>
typedef int DataType;
misplaced there is
#include < new > however, while I'm copying it here the site editor seems that as a HTML tag as far as I see, thanks.
I thought that may be you can help me on some crucial...
I got the example but I couldn't apply it to my example :confused:
Then Mr.Miill you mean, should I define all the functions in StackA.h and delete the StackA.cpp file?
Do you have any example for me to see how these templates work? (I don't know templates much)...
But if I don't use StackA.cpp, how can the compiler understand what is inside of my functions? The StackA.h only holds function prototypes.
Thanks,
StackA.h
#ifndef STACKA_H
#define STACKA_H
// *********************************************************
// Header file StackA.h for the ADT stack.
// Array-based implementation.
//...
Yes Salem, I did it like that(as you said) but compiler gave me an error as I mentioned above. Nonetheless, its executable works from command prompt without any error.
Thank you...
This can be because of The Brain's explanation but when I do the typedef of ArrayType as a pointer to int, compiler gives me many errors and things get confusing.
I think I need to study this...
Thank you Salem, I got it.
It compiles successful but in run-time it gives an error like,
Error 1 Error result 1 returned from 'C:\Program Files\Microsoft Visual Studio...
When I do like what Salem said, it gives an error like
Error 1 error C2664: 'findSum' : cannot convert parameter 1 from 'ArrayType [7]' to 'int []' c:\Documents and Settings\Sarp\My...
#include <iostream>
const int MIN_ELEMENTS = 5;
typedef int ArrayType[MIN_ELEMENTS];
typedef int ElementType;
bool findSum( ArrayType myArray[], int n )
{
ElementType firstFiveSum = 0;