I replaced the code and got an error saying that it could not access "next" because it was a private member. So I tried putting it into the public section and now there's no compile error, but I'm...
Type: Posts; User: UserName112
I replaced the code and got an error saying that it could not access "next" because it was a private member. So I tried putting it into the public section and now there's no compile error, but I'm...
Should head be declared in public? I'm kinda confused about where to put it.
I'm not too familiar with the debugger.
Added in the addAtBack function and now it's showing a blank output screen along with the error from above. I can't figure out what I'm doing wrong.
#ifndef NODE_CLASS
#define NODE_CLASS
...
I changed some things around and I got the output/addAtFront to work with no compile error, but for some reason I keep getting this:
11203
Am I getting that error because I'm forgetting to add...
Not sure what I'm doing wrong, but the only error I seem to be getting is:
visual studio 2010\projects\linked list\linked list\d_node.cpp(11): error C3861: 'outputList': identifier not found
...
I made the "addAtFront" function, but not sure if I'm doing it right.
This is what I have so far. Can you tell me if I'm going the right direction?
#ifndef NODE_CLASS
#define NODE_CLASS
...
How would you go about studying for this topic? It's very confusing. I tried reading a book, but I have no idea what its talking about most of the time. I kind of get how single linked lists works,...
Identify all the errors that occur in each of the following statements. Say “no error” if
there is no error.
(a) vector<int> *vPtr;
vPtr = new vector<int>(15);
(b) int a[20], b[10];
b = a;
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
void insertionSort(vector<T> &v1);
int main()
{
const int SIZE = 5;
int myArray[SIZE] =...
So in the first one you can use the argument in calculations and such, but you just can't change it, right? I'm not quite sure on what the second one means.
returntype functionName(const testClass& obj);
returntype functionName(testClass& obj) const;
What is the difference between having const inside the argument list and outside?
Got it. Thanks!
#ifndef TEST
#define TEST
using namespace std;
template <typename T>
class Test
{
private:
T number;
public: