#include <iostream>
using namespace std;
typedef int vertex;
enum vertexstate { white, gray, black };
class graph
{
private:
bool**adjacencymatrix;
int vertexcount;
public:
graph(int vertexcount);
~graph();
void addedge(int i, int j);
void removeedge(int i, int j);
bool isedge(int i, int j);
void display();
void Dfs();
void runDfs(int u, vertexstate state[]);
};
graph::graph(char filename[], int vertexcount) //error is here
{
this->vertexcount = vertexcount;
adjacencymatrix = new bool*[vertexcount];
for (int i = 0; i<vertexcount; i++)
{
adjacencymatrix[i] = new bool[vertexcount];
for (int j = 0; j<vertexcount; j++)
adjacencymatrix[i][j] = false;
}
how to fix: "out of line definition of 'graph' does not match any declaration in 'graph'"
2.1k Views Asked by Penrose5833 At
1
There are 1 best solutions below
Related Questions in C++
- C++ using std::vector across boundaries
- Linked list without struct
- Connecting Signal QML to C++ (Qt5)
- how to get the reference of struct soap inherited in C++ Proxy/Service class
- Why we can't assign value to pointer
- Conversion of objects in c++
- shared_ptr: "is not a type" error
- C++ template using pointer and non pointer arguments in a QVector
- C++ SFML 2.2 vectors
- Lifetime of temporary objects
- I want to be able to use 4 different variables in a select statement in c ++
- segmentation fault: 11, extracting data in vector
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- How can I print all the values in this linked list inside a hash table?
- Configured TTL for A record(s) backing CNAME records
Related Questions in XCODE
- Using Storyboard Reference
- Getting this message in my console in xcode "Ignoring restoreCompletedTransactionsWithApplicationUsername: because already restoring transactions"?
- Error when creating UIImage
- fade in an bounce animation subview
- How to delete static library ".a" file from xcode project?
- Error in main.storyboard
- Is the compiler Xcode uses to produce Assembly code a bad compiler?
- Using paths bonded to a XCode project to be shared
- How to set the time of Local notification in app to random between two times? (swift)
- "Invalid Signature, code object not signed at all" error
- Alarming memory increase with custom segue
- Display both alertTitle and AlertBody on a custom WatchKit notification
- How to make a CocoaPods project work on OS X El Capitan & Xcode 7 Beta?
- Cannot use CTRL+Drag for making a button action in Xcode?
- Labels properties changing in Xcode
Related Questions in CLASS
- Access objects variable & method by name
- Pass variables to extended class
- Threading Segfault when reading members
- __PHP_Incomplete_Class Object even though class is included before session started
- How to declare a class with a constructior outside of a function C++
- ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
- Java: set and get methods for strings
- Allow extension of class by injection of user-made subclass, while preserving accessibility
- Efficiency penalty of initializing a struct/class within a loop
- Possible to add a new class that can be cast to an existing final class?
- introduce c++ into html
- how can Object class in ruby be an instance of it's subclass, class "Class"
- Class enumerator values cannot be passed as parameters to another class's function
- Passive Objects in C++
- open class or implicit class in java
Related Questions in DECLARATION
- Function returning another function
- Is "long long" = "long long int" = "long int long" = "int long long"?
- What is the point of declaring a variable as one class, and allocating memory to it with another class?
- In which part of memory different variables get stored? Who will assign the value to it before starting main?
- What's the benefit for a C source file include its own header file
- Error: Not found: Value S (Scala)
- How to properly declare handlers
- Php Variable declaration error - MySQL
- Where is the AMPathPopUpButton class declared?
- Expected identifier in C
- C++ declaring multiple variables in the same line
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'oxm:jaxb2-marshaller'
- C++ constructor bug
- Error w/declaration on else statement (C++)
- Angular: when using ng-include, number variable become NaN
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Apart from your code sample being incomplete and you not really formulating a question....
Your constructor is defined as
graph(int vertexcount);yet your implementation uses different parameters:graph(char filename[], int vertexcount).You have 2 possibilities depending on what you are tryin to achieve:
1) You can change the definition in your class to
graph(char filename[], int vertexcount)2) You can change your implementation to read like this:#
In case you need filename: I would recommend to use
const std::string&as parameter type - or at leastconst char*...