why the screen is not clear....even though i used system("cls");.....like void does nothing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include<iostream>
#include<stdlib.h>
usingnamespace std;
void clear();
int main(){
cout<<"this line need to be cleared";
void clear();
}
void clear()
{
system("cls");
}
Because the function that you want to call is "clear();" void is to indicates that this function doesn't return anything, it should not be a part of the function call.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include<iostream>
#include<stdlib.h>
usingnamespace std;
void clear();
int main(){
cout<<"this line need to be cleared";
clear();
}
void clear()
{
system("cls");
}
or maybe you wrong....even though i use int clear()....the same thing still happens
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include<iostream>
#include<stdlib.h>
usingnamespace std;
int clear();
int main(){
cout<<"this line need to be cleared";
int clear();
}
int clear()
{
system("cls");
}
now...i do not use system("cls") anymore,,,,but nothing happens in " int clear() "...check this out.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include<iostream>
#include<stdlib.h>
usingnamespace std;
int clear();
int main(){
cout<<"this line need to be cleared";
int clear();
}
int clear()
{
cout<<"ok ";
}