in this below code macro 1 is always fine
but, macro 2 is not working if statement 1 is not written..why is this happening?
#include<iostream>
#include<conio.h>
//using namespace std; //--statement 1
#define l std::cout<< //--macro 1
#define nl std::cout<<endl; //--macro 2
int main(){
l "testing";
nl // this is not working if i dont use statement 1
l "a new line";
getch();
return 0;
}
when statement 1 is not written macro 2 is producing a error stating that '[Error]endl was not declared in this scope'
if cout<<
is the short version of std::cout<<
, this error should not happen...i can not understand why is this happening...