Im new to C++. I get error on the statements marked //this shows error
but its alternative (marked as but this works
). Can someone explain this please?
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
Node *next;
int data;
};
class Que
{
public:
//this shows error
/*
Node *front, *rear;
front = NULL;
rear = NULL;
*/
//but this works
Node *front = NULL, *rear = NULL;
};