This question already has answers here:
Function clrscr in C and C++
(5 answers)
"UNDEFINED REFRENCE TO clrscr();" [duplicate]
(2 answers)
Closed 2 years ago.
I'm a new C programming learner. I'm writing a code by including stdio.h and conio.h but if I write clrscr(); inside my code, it isn't working. If I remove the part clrscr(); it's working. Why??
Here's the source code:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("A tab \tis used in this line.");
getch();
}
Related
This question already has answers here:
Why does pow(n,2) return 24 when n=5, with my compiler and OS?
(4 answers)
Why does pow(5,2) become 24? [closed]
(3 answers)
Closed 2 years ago.
This code is part of an original code
Why the output of this code displays the number 24?
The output of this Code should be number 25!
Where's the problem with this code?
The compiler used is CodeBlocks
Thanks
int A=7;
A = pow((((A+1)/2)+1),2);
printf("%d", A);
This question already has answers here:
Why does C allow me to call an undeclared function? [duplicate]
(1 answer)
Function assigns incorrect float value in C
(1 answer)
Closed 3 years ago.
Hey guys I was wondering why my program was just returning junk and I found out that I didn't include math.h. But why did the code even compile and run if there isn't any definition for the function ?
#include <stdio.h>
int main()
{
int ka = 0;
ka = sqrt(4);
printf("ha ist %d", ka);
system("PAUSE");
return 0;
}
This question already has answers here:
Error with clrscr() on Dev C++ 5.4.2
(6 answers)
"UNDEFINED REFRENCE TO clrscr();" [duplicate]
(2 answers)
Closed 3 years ago.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
printf("Enter the number to be displayed");
scanf("%d",&i);
printf("The entered number is %d",i);
getch();
}
I am able to run the above program in Turbo C++ but in Dev C++ I'm getting this error.
error:
<conio.h> is a non-standard header provided by Borland and a handful of other compilers and libc implementations. Dev C++ typically uses one of the Windows GCC ports, which don't provide any implementation of those functions.
If you want to use some sort of clrscr function in both you're going to have to come up with a more portable solution, because <conio.h> will not work with GCC.
This question already has answers here:
What is "!!" in C? [duplicate]
(7 answers)
!! c operator, is a two NOT?
(4 answers)
Closed 3 years ago.
I was going through the WARN_ON_ONCE macro definition. I have doubt regarding the following line, what is the use of !! before condition. If we remove !! then also same will be stored in __ret_warn_once.
int __ret_warn_once = !!(condition);
What will happen when compiler executing the following source line.
static bool __section(.data.unlikely) __warned;
This question already has answers here:
Is uninitialized data behavior well specified?
(7 answers)
What will be the value of uninitialized variable? [duplicate]
(6 answers)
Closed 8 years ago.
Please explain why I am getting output 2 here. My expected o/p is 5 or 7. Please throw some light. Thank you!
#include<stdio.h>
typedef enum {a=3, b, c, d, j}e;
void f(e *e1) {
printf("%ld", (int)*e1);
}
main(){
e es;
f(&es);
}
You haven't initialized es, so your program is just printing the random value that happens to be on the stack when the program runs.
You need to say something like:
e es = c;
That will give you the 5 output you seek.