Hi guys,
I am having a trouble with creating a clreol(); (clear end of line) function in C language. And also I am using Devc++. Can any one please provide the source code of this header file?
clreol();
Page 1 of 18 Replies - 1630 Views - Last Post: 24 February 2012 - 12:21 PM
Replies To: clreol();
#2
Re: clreol();
Posted 24 February 2012 - 09:45 AM
This isn't a homework writing service, you need to show some effort before anyone here is going to help you. Just think about the problem and what you're trying to do. Usually, the console size is 80 characters wide by 24/25 lines. So all you really need to do is to output the correct number of newlines: '\n' to the screen and it should be cleared out.
#3
Re: clreol();
Posted 24 February 2012 - 09:45 AM
What header file are you talking about? Normally, if this non-standard function exists, you would just include the proper header file. However this function is not available with most modern compilers, it was only available with an old outdated, obsolete compiler, which I will not name.
Jim
Jim
#4
Re: clreol();
Posted 24 February 2012 - 10:07 AM
jimblumberg, on 24 February 2012 - 09:45 AM, said:
What header file are you talking about? Normally, if this non-standard function exists, you would just include the proper header file. However this function is not available with most modern compilers, it was only available with an old outdated, obsolete compiler, which I will not name.
Jim
Jim
in conio.h library there are no clreol.c functions. So I'm trying to create a header file for the clreol(); function. I've got some other header source codes but it seems like not working.
Here is the codings I got through the net
#include <conio.h>
void clreol (void)
{
if (!ConioInitialized)
textmode(LASTMODE);
wclrtoeol(CurrentWindow);
wrefresh(CurrentWindow);
}
#5
Re: clreol();
Posted 24 February 2012 - 10:17 AM
Did you not read the last line of jimblumberg's post? The header file you're trying to use is very old and outdated. It's also non-portable so you shouldn't get used to using it. Just come up with your own function. This wouldn't be that hard of a function to write. You just need to output the correct number of newlines.
#6
Re: clreol();
Posted 24 February 2012 - 11:25 AM
Actually I was talking about the function, not the header file. The conio.h header file is still supplied by most of the current Windows compilers. This function, however is not supplied by most of these modern Windows compilers (I'll even include the outdated Devc++ as modern).
I do agree that the use of the conio.h header file should be discouraged for most usages. I also agree that this header is non-portable, it only works for a Windows console program.
Jim
I do agree that the use of the conio.h header file should be discouraged for most usages. I also agree that this header is non-portable, it only works for a Windows console program.
Jim
This post has been edited by jimblumberg: 24 February 2012 - 11:25 AM
#7
Re: clreol();
Posted 24 February 2012 - 11:53 AM
jimblumberg, on 24 February 2012 - 11:25 AM, said:
Actually I was talking about the function, not the header file. The conio.h header file is still supplied by most of the current Windows compilers. This function, however is not supplied by most of these modern Windows compilers (I'll even include the outdated Devc++ as modern).
I do agree that the use of the conio.h header file should be discouraged for most usages. I also agree that this header is non-portable, it only works for a Windows console program.
Jim
I do agree that the use of the conio.h header file should be discouraged for most usages. I also agree that this header is non-portable, it only works for a Windows console program.
Jim
Yes Jim you are right. And I was trying to create my own program, and I had to clear the end line of the printf(); statement so I searched for it and got the option called clreol(); and it normally included in the conio.h library. Since I am using DevC++ not all of the functions those are available in conio.h are accessible(But I earlier used turbo C and it worked well). Only few functions are accessible, such as getch(); . Since I am an Beginner - Intermediate programmer I have to go through some more books and sources again.
so, can you please suggest some books and sources for my studies Jim?
#8
Re: clreol();
Posted 24 February 2012 - 12:18 PM
You may want to look at the topic in the C++ discussion forum for a list of Book recommendations. There are quite a few good recommendations such as this Book list provided by Salem_c in post #4.
Jim
Jim
#9
Re: clreol();
Posted 24 February 2012 - 12:21 PM
jimblumberg, on 24 February 2012 - 12:18 PM, said:
You may want to look at the topic in the C++ discussion forum for a list of Book recommendations. There are quite a few good recommendations such as this Book list provided by Salem_c in post #4.
Jim
Jim
Thank you Jim
have a nice day
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|