In the constructor, you set root to Null.
Then in insertNode, you do:
cursor = root;
while(cursor->getNextNode())
You need to allocate a root node, or deal with it being Null.
More Related Contents:
- CPP- I am getting Segmentation fault (core dumped)?
- Reading garbage instead of segfault for non-existant memory locations
- I keep getting a segfault every time I run this program, but I cannot understand why
- Segmentation fault on large array sizes
- What is a segmentation fault?
- Definitive List of Common Reasons for Segmentation Faults
- Adding external library into Qt Creator project
- Why don’t I get a segmentation fault when I write beyond the end of an array?
- cudaMemcpy segmentation fault
- How to link opencv in QtCreator and use Qt library
- Determine the line of code that causes a segmentation fault?
- How to catch segmentation fault in Linux?
- Qt: can’t find -lGL error
- What can cause segmentation faults in C++? [closed]
- Fixing Segmentation faults in C++
- Qt Creator – Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild
- Segmentation fault at glGenVertexArrays( 1, &vao );
- Configuring the GCC compiler switches in Qt, QtCreator, and QMake
- SetJmp/LongJmp: Why is this throwing a segfault?
- Where in Qt Creator do I pass arguments to a compiler?
- Segfaults in malloc() and malloc_consolidate()
- Using a static library in Qt Creator
- Making my own photo-mosaic app with Qt using C++
- Why is a segmentation fault not recoverable?
- How to avoid entering library’s source files while debugging in Qt Creator with gdb?
- Best practices for recovering from a segmentation fault
- Default variable value
- C++ ABI issues list
- How to ensure constexpr function never called at runtime?
- How to implement readlink to find the path