is there any way to make c, asm, or c++ draw on the screen
i want to beable to use n libaries, header files, or and thing thats external like windows, or dos
so basicaly what i need to know is how to do cout with out #include<iostream>
it needs to be from scratch
i have a linker, and a compiler that with compile the mixed laugues
and convert it to a binary
why? i want to make my own program that can draw using code not other programs funtions like windows an dos,
i do know that is a lot of code probaly
so any input will be valued
heres basicaly what i want in my program the draw(x,y);
will turn on a pixtal on the screen
but before this i probaly sould set sizes for the screen x,y
for starters anything like 100 width, by 100 height would be fine
and no other header files
/
Draw a dot, line, or other on screen
using no header files other than iostream
using am or c/
include<iostream>//input/output
using namespace std;
void draw(int,int);
void wait();
int main()
{//main
int x,y;
cout<<"\t\t\t\t\tProgram 1\n";
cout<<"x: ";
cin>>x;
cout<<"\ny: ";
cin>>y;
draw(1,1);
wait();
return 0;
}
void draw(int x, int y){
//function for drawing x, y
/
using c, or asm
function will be a bit for compplex then x,y/
}
/
I know, i know cin.get will get a letter well all i want right now
for it to wait no getch(); or pause; will build own function later/
void wait(){
cin.get();
}
code above has been tested and run with 0 erros or warnings, some what noted
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
>> copy that into a text file and save it as iostream.h
>> but put it in a diff folder from everything else
No. It serves no purpose for me to do that.
If you insist in drip feeding important information, and then presenting such information in an inappropriate manner, I can only assume that you no longer require assistance. I did not need to see your implementation of iostream, it would have been sufficient to explain that you had your own portable, platform independent implementation.
That said, as I pointed out in the first response, iostream has nothing to do with plotting individual pixels, so I am still confused as to why you even brought it into the discussion in the frost place. You have addressed probably the least important and relevant aspect of my confusion and omitted to provide other information requested.
Since you did not say otherwise, I assume that the suggestion that you use the video BIOS was what you were looking for and that therefore your issue is solved. If not you will have to start making more sense since I am now bored with this.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"basicaly what i need to know is how to do cout with out #include<iostream>"
and then later said
"basicaly what i want in my program the draw(x,y); will turn on a pixtal on the screen"
but you can't do the latter with cout in any case.
The fact is that C & C++ do not have any built-in I/O capabilities - you have to use libraries of some kind or another. In principle you could use direct memory access to modify the screen display buffer content or access the video hardware, but Windows has control of the screen and video hardware, and it is a protected mode operating system - so it won't let you do that unless you write kernel level code. The interface to the display in Windows is a library (primarily GDI, but also directDraw or OpenGL).
To be frank, if you have to ask the question, you do not know enough to be able to do it. I only know enough to know how pointless it would be to try! The problem with writing directly to the hardware is that not all hardware is the same - one of the primary benefits of Windows over say MS-DOS is that because Windows provides a common interface to the hardware, through manufacturer supplied device drivers, the hardware no-longer needs to be standardised, and video hardware is probably the component with the greatest variety. To avoid device driver accesses through the OS (which is essentially what you are asking) You would have to write different code for every possible piece of hardware your code would run on, have intimate knowledge of that hardware, and be able to identify which hardware is present (you could ask the OS, but you don't want to do that it seems! ;-)
The question you are asking only really makes any sense in the case of an embedded system with custom display hardware. But in that case we could not answer the question without knowledge of the hardware.
>> i have a linker, and a compiler that with compile
>> the mixed laugues and convert it to a binary
Yes that is generally what a compiler and linker do! Given the nature of this forum most of us already know that! However, if you are not using Dev-C++ specifically, then you may be in an inappropriate forum. That said, if we can help we generally do.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes that is generally what a compiler and linker do! Given the nature of this forum most of us already know that! However, if you are not using Dev-C++ specifically, then you may be in an inappropriate forum. That said, if we can help we generally do.
I guess i am in the wrong forms, all ive been able to do with asm, c, c++ is to make functions like wait for key, wait for command, clearing ram, making a boot, and building a kernel. but now im stuck cuse all i get is that black screen with white text, i know that the text style is from the mother board becuse they have a built in text. so i will continue my search for a way to use asm to use the vedio card.
To be frank, if you have to ask the question, you do not know enough to be able to do it. I only know enough to know how pointless it would be to try! The problem with writing directly to the hardware is that not all hardware is the same - one of the primary benefits of Windows over say MS-DOS is that because Windows provides a common interface to the hardware, through manufacturer supplied device drivers, the hardware no-longer needs to be standardised, and video hardware is probably the component with the greatest variety. To avoid device driver accesses through the OS (which is essentially what you are asking) You would have to write different code for every possible piece of hardware your code would run on, have intimate knowledge of that hardware, and be able to identify which hardware is present (you could ask the OS, but you don't want to do that it seems! ;-)
why would you say i dont have enough to use the vedio card? you can take almost all the componets out of a computer and turn it on and the bios and boot squence will turn on the vedio card and dislay text
with a very small pice of information.
reasons for doing this well i have the boot wriiten, some of the kernel, and most of the cmd-line shell. all i need is do disaplay and a interface, ive gotten some code to run and given me mouse x/y but i used soem of windows code im trying to use all my own code. so far the only header files my whole os uses is iostream, and the rest is mine. i did functions like getch, clrscr(), kbhit(), vector(), time(), in asm ... i hate asm so musch code...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please if you quote someone else's post, please make it clear in the conventional way which is the quote and which is your response!
>> why would you say i dont have enough to use the vedio card?
I would say that because you did not give us complete information. This is a forum for users of Bloodshed Software. The primary prouduct of Bloodshed is Dev-C++ a Windows IDE for C/C++ development using by default MinGW a Windows compiler. So the fair assumption is that unless you specify otherwise, that is what you are using, and in that context your question made little sense.
I wonder why you did not consider it relevant to mention that what you are actually doing is bringing up a 'bare-metal' processor board!? You are essentially doing what I suggested, bringing up an embedded system.
>> ive gotten some code to run and given me mouse x/y but
>> i used soem of windows code im trying to use all my own code.
How could you possibly use and Windows code unless Windows is running!? What you are doing is either very nieve or very complex, but either way there is something missing from what you are telling us. And that makes it near impossible to answer your question.
>> so far the only header files my whole os uses is iostream
This sounds again like a contradiction, or missing information. iostream generally requires OS support or at least some sort of target support hooks, including iostream actually pulls in a large amount of other code (typically at least the C library's stdio). Perhaps it would make more sense if you could tell us what development tools and who's C/C++ libraries you are using?
The way to bring up and embedded or bare board system is usually not to avoid the standard library, but rather to add support for the standard library to your platform. For example if you use the Open Source Newlib library as the underlying C library (usually a pre-requisite for a C++ library), you have to implement the "syscalls" stubs to map teh library to your system. If that is an OS, you use use calls, if it is a bare-metal system, you implement the code yourself. It is not clear here what you have done or how.
Getting back to your question, I am not sure if this is an answer because your statements add so much confusion, but on a bare x86 based system with any sort of video interface, there will be a Video BIOS which is an extension to the mother boards BIOS. It is lowest common denominator stuff, but can be used to get you started on selecting graphics modes and finding the display memory and writing to it. Google "VESA BIOS" and "int 10h" to get information on how to do this. But again, to be frank, if you were not aware of this already, it seems unlikely that you are really doing what it seems you are saying you are doing. Anyone who can bootstrap a baseboard would surely be aware of the BIOS services. You even mentioned the BIOS in your last response!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Overkill
>> so far the only header files my whole os uses is iostream
Clifford
>>This sounds again like a contradiction, or missing information. >>iostream generally requires OS support or at least some sort of >>target support hooks, including iostream actually pulls in a large >>amount of other code (typically at least the C library's stdio). >>Perhaps it would make more sense if you could tell us what >>development tools and who's C/C++ libraries you are using?
The only reason i was using iostream was becuse i was too lazy to write my own i/o files, but the iostream was using was cute up very badly and linking code was removed and the code from those files was put into the same header. i am not using any other headers than iostream.h its modififed from dev, borland and some other one and yes it is iostream.h not iostream the new one
void far * far cdecl _fmemccpy(void far dest, const void far *src,
int c, size_t n);
void far * far cdecl _fmemchr(const void far *s, int c, size_t n);
int far cdecl _fmemcmp(const void far *s1, const void far s2,
size_t n);
void far * far cdecl _fmemcpy(void far dest, const void far *src,
size_t n);
int far cdecl _fmemicmp(const void far *s1, const void far s2,
size_t n);
void far * far cdecl _fmemmove(void far dest, const void far *src,
size_t n);
void far * far cdecl _fmemset(void far *s, int c, size_t n);
void far cdecl _fmovmem(const void far *src, void far dest,
unsigned length);
void far cdecl _fsetmem(void far *dest,unsigned length,
char __value);
static const long basefield;
static const long adjustfield;
static const long floatfield;
_Cdecl ios(streambuf );
virtual _Cdecl ~ios();
long _Cdecl flags();
long _Cdecl flags(long);
long _Cdecl setf(long _setbits, long _field);
long _Cdecl setf(long);
long _Cdecl unsetf(long);
int _Cdecl width();
int _Cdecl width(int);
char _Cdecl fill();
char _Cdecl fill(char);
int _Cdecl precision(int);
int _Cdecl precision();
ostream * _Cdecl tie(ostream );
ostream * _Cdecl tie();
int _Cdecl rdstate();
int _Cdecl eof();
int _Cdecl fail();
int _Cdecl bad();
int _Cdecl good();
void _Cdecl clear(int = 0);
_Cdecl operator void * ();
int _Cdecl operator! ();
streambuf * _Cdecl rdbuf();
static long _Cdecl bitalloc();
static int _Cdecl xalloc();
long & _Cdecl iword(int);
void * & _Cdecl pword(int);
static void _Cdecl sync_with_stdio();
int _Cdecl skip(int);
virtual streambuf * _Cdecl setbuf( signed char *, int);
streambuf * _Cdecl setbuf(unsigned char *, int);
streambuf * _Cdecl setbuf(char *, int, int);
int _Cdecl sgetc();
int _Cdecl snextc();
int _Cdecl sbumpc();
void _Cdecl stossc();
int _Cdecl sgetn(char *, int);
virtual int _Cdecl do_sgetn(char *, int);
virtual int _Cdecl underflow();
int _Cdecl sputbackc(char);
virtual int _Cdecl pbackfail(int);
int _Cdecl in_avail();
int _Cdecl sputc(int);
int _Cdecl sputn(const char *, int);
virtual int _Cdecl do_sputn(const char * s, int n);
virtual int _Cdecl overflow(int = EOF);
int _Cdecl out_waiting();
virtual streampos _Cdecl seekoff(streamoff, ios::seek_dir,
int = (ios::in | ios::out));
virtual streampos _Cdecl seekpos(streampos, int = (ios::in | ios::out));
virtual int _Cdecl sync();
copy that into a text file and save it as iostream.h but put it in a diff folder from everything else
and put this code on a other text file and run it
is there any way to make c, asm, or c++ draw on the screen
i want to beable to use n libaries, header files, or and thing thats external like windows, or dos
so basicaly what i need to know is how to do cout with out #include<iostream>
it needs to be from scratch
i have a linker, and a compiler that with compile the mixed laugues
and convert it to a binary
why? i want to make my own program that can draw using code not other programs funtions like windows an dos,
i do know that is a lot of code probaly
so any input will be valued
heres basicaly what i want in my program the draw(x,y);
will turn on a pixtal on the screen
but before this i probaly sould set sizes for the screen x,y
for starters anything like 100 width, by 100 height would be fine
and no other header files
/
Draw a dot, line, or other on screen
using no header files other than iostream
using am or c/
include<iostream>//input/output
using namespace std;
void draw(int,int);
void wait();
int main()
{//main
int x,y;
cout<<"\t\t\t\t\tProgram 1\n";
cout<<"x: ";
cin>>x;
cout<<"\ny: ";
cin>>y;
draw(1,1);
wait();
return 0;
}
void draw(int x, int y){
//function for drawing x, y
/
using c, or asm
function will be a bit for compplex then x,y/
}
/
I know, i know cin.get will get a letter well all i want right now
for it to wait no getch(); or pause; will build own function later/
void wait(){
cin.get();
}
code above has been tested and run with 0 erros or warnings, some what noted
>> copy that into a text file and save it as iostream.h
>> but put it in a diff folder from everything else
No. It serves no purpose for me to do that.
If you insist in drip feeding important information, and then presenting such information in an inappropriate manner, I can only assume that you no longer require assistance. I did not need to see your implementation of iostream, it would have been sufficient to explain that you had your own portable, platform independent implementation.
That said, as I pointed out in the first response, iostream has nothing to do with plotting individual pixels, so I am still confused as to why you even brought it into the discussion in the frost place. You have addressed probably the least important and relevant aspect of my confusion and omitted to provide other information requested.
Since you did not say otherwise, I assume that the suggestion that you use the video BIOS was what you were looking for and that therefore your issue is solved. If not you will have to start making more sense since I am now bored with this.
Clifford
You are yourself, you first said:
"basicaly what i need to know is how to do cout with out #include<iostream>"
and then later said
"basicaly what i want in my program the draw(x,y); will turn on a pixtal on the screen"
but you can't do the latter with cout in any case.
The fact is that C & C++ do not have any built-in I/O capabilities - you have to use libraries of some kind or another. In principle you could use direct memory access to modify the screen display buffer content or access the video hardware, but Windows has control of the screen and video hardware, and it is a protected mode operating system - so it won't let you do that unless you write kernel level code. The interface to the display in Windows is a library (primarily GDI, but also directDraw or OpenGL).
To be frank, if you have to ask the question, you do not know enough to be able to do it. I only know enough to know how pointless it would be to try! The problem with writing directly to the hardware is that not all hardware is the same - one of the primary benefits of Windows over say MS-DOS is that because Windows provides a common interface to the hardware, through manufacturer supplied device drivers, the hardware no-longer needs to be standardised, and video hardware is probably the component with the greatest variety. To avoid device driver accesses through the OS (which is essentially what you are asking) You would have to write different code for every possible piece of hardware your code would run on, have intimate knowledge of that hardware, and be able to identify which hardware is present (you could ask the OS, but you don't want to do that it seems! ;-)
The question you are asking only really makes any sense in the case of an embedded system with custom display hardware. But in that case we could not answer the question without knowledge of the hardware.
>> i have a linker, and a compiler that with compile
>> the mixed laugues and convert it to a binary
Yes that is generally what a compiler and linker do! Given the nature of this forum most of us already know that! However, if you are not using Dev-C++ specifically, then you may be in an inappropriate forum. That said, if we can help we generally do.
Clifford
Yes that is generally what a compiler and linker do! Given the nature of this forum most of us already know that! However, if you are not using Dev-C++ specifically, then you may be in an inappropriate forum. That said, if we can help we generally do.
I guess i am in the wrong forms, all ive been able to do with asm, c, c++ is to make functions like wait for key, wait for command, clearing ram, making a boot, and building a kernel. but now im stuck cuse all i get is that black screen with white text, i know that the text style is from the mother board becuse they have a built in text. so i will continue my search for a way to use asm to use the vedio card.
To be frank, if you have to ask the question, you do not know enough to be able to do it. I only know enough to know how pointless it would be to try! The problem with writing directly to the hardware is that not all hardware is the same - one of the primary benefits of Windows over say MS-DOS is that because Windows provides a common interface to the hardware, through manufacturer supplied device drivers, the hardware no-longer needs to be standardised, and video hardware is probably the component with the greatest variety. To avoid device driver accesses through the OS (which is essentially what you are asking) You would have to write different code for every possible piece of hardware your code would run on, have intimate knowledge of that hardware, and be able to identify which hardware is present (you could ask the OS, but you don't want to do that it seems! ;-)
why would you say i dont have enough to use the vedio card? you can take almost all the componets out of a computer and turn it on and the bios and boot squence will turn on the vedio card and dislay text
with a very small pice of information.
reasons for doing this well i have the boot wriiten, some of the kernel, and most of the cmd-line shell. all i need is do disaplay and a interface, ive gotten some code to run and given me mouse x/y but i used soem of windows code im trying to use all my own code. so far the only header files my whole os uses is iostream, and the rest is mine. i did functions like getch, clrscr(), kbhit(), vector(), time(), in asm ... i hate asm so musch code...
Please if you quote someone else's post, please make it clear in the conventional way which is the quote and which is your response!
>> why would you say i dont have enough to use the vedio card?
I would say that because you did not give us complete information. This is a forum for users of Bloodshed Software. The primary prouduct of Bloodshed is Dev-C++ a Windows IDE for C/C++ development using by default MinGW a Windows compiler. So the fair assumption is that unless you specify otherwise, that is what you are using, and in that context your question made little sense.
I wonder why you did not consider it relevant to mention that what you are actually doing is bringing up a 'bare-metal' processor board!? You are essentially doing what I suggested, bringing up an embedded system.
>> ive gotten some code to run and given me mouse x/y but
>> i used soem of windows code im trying to use all my own code.
How could you possibly use and Windows code unless Windows is running!? What you are doing is either very nieve or very complex, but either way there is something missing from what you are telling us. And that makes it near impossible to answer your question.
>> so far the only header files my whole os uses is iostream
This sounds again like a contradiction, or missing information. iostream generally requires OS support or at least some sort of target support hooks, including iostream actually pulls in a large amount of other code (typically at least the C library's stdio). Perhaps it would make more sense if you could tell us what development tools and who's C/C++ libraries you are using?
The way to bring up and embedded or bare board system is usually not to avoid the standard library, but rather to add support for the standard library to your platform. For example if you use the Open Source Newlib library as the underlying C library (usually a pre-requisite for a C++ library), you have to implement the "syscalls" stubs to map teh library to your system. If that is an OS, you use use calls, if it is a bare-metal system, you implement the code yourself. It is not clear here what you have done or how.
Getting back to your question, I am not sure if this is an answer because your statements add so much confusion, but on a bare x86 based system with any sort of video interface, there will be a Video BIOS which is an extension to the mother boards BIOS. It is lowest common denominator stuff, but can be used to get you started on selecting graphics modes and finding the display memory and writing to it. Google "VESA BIOS" and "int 10h" to get information on how to do this. But again, to be frank, if you were not aware of this already, it seems unlikely that you are really doing what it seems you are saying you are doing. Anyone who can bootstrap a baseboard would surely be aware of the BIOS services. You even mentioned the BIOS in your last response!
Clifford
Overkill
>> so far the only header files my whole os uses is iostream
Clifford
>>This sounds again like a contradiction, or missing information. >>iostream generally requires OS support or at least some sort of >>target support hooks, including iostream actually pulls in a large >>amount of other code (typically at least the C library's stdio). >>Perhaps it would make more sense if you could tell us what >>development tools and who's C/C++ libraries you are using?
The only reason i was using iostream was becuse i was too lazy to write my own i/o files, but the iostream was using was cute up very badly and linking code was removed and the code from those files was put into the same header. i am not using any other headers than iostream.h its modififed from dev, borland and some other one and yes it is iostream.h not iostream the new one
/-----------------------------------------------------------/
ifndef __IOSTREAM_H
define __IOSTREAM_H
define _FAR
define _FARFUNC
if defined( __cplusplus )
define _PTRDEF(name) typedef name * P##name;
define _REFDEF(name) typedef name & R##name;
define _REFPTRDEF(name) typedef name * & RP##name;
define _PTRCONSTDEF(name) typedef const name * PC##name;
define _REFCONSTDEF(name) typedef const name & RC##name;
define _CLASSDEF(name) class _CLASSTYPE name; \
endif
endif
if !defined( __MEM_H )
ifndef NULL
include <_null.h>
endif
ifndef _STDDEF
define _STDDEF
ifndef _PTRDIFF_T
define _PTRDIFF_T
if defined(LARGE) || defined(HUGE) || defined(COMPACT)
typedef long ptrdiff_t;
else
typedef int ptrdiff_t;
endif
endif
ifndef _SIZE_T
define _SIZE_T
typedef unsigned size_t;
endif
endif
ifdef __cplusplus
extern "C" {
endif
void * _Cdecl memccpy(void dest, const void *src,
int c, size_t n);
void * _Cdecl memchr(const void s, int c, size_t n);
int _Cdecl memcmp(const void *s1, const void s2,
size_t n);
void * _Cdecl memcpy(void dest, const void *src,
size_t n);
int _Cdecl memicmp(const void *s1, const void s2,
size_t n);
void * _CType memmove(void dest, const void *src,
size_t n);
void * _CType memset(void *s, int c, size_t n);
void _Cdecl movedata(unsigned srcseg, unsigned srcoff,
unsigned dstseg,unsigned dstoff, size_t n);
void _Cdecl movmem(const void *src, void dest,
unsigned length);
void _Cdecl setmem(void dest,unsigned length, char __value);
if !STDC
void far * far cdecl _fmemccpy(void far dest, const void far *src,
int c, size_t n);
void far * far cdecl _fmemchr(const void far *s, int c, size_t n);
int far cdecl _fmemcmp(const void far *s1, const void far s2,
size_t n);
void far * far cdecl _fmemcpy(void far dest, const void far *src,
size_t n);
int far cdecl _fmemicmp(const void far *s1, const void far s2,
size_t n);
void far * far cdecl _fmemmove(void far dest, const void far *src,
size_t n);
void far * far cdecl _fmemset(void far *s, int c, size_t n);
void far cdecl _fmovmem(const void far *src, void far dest,
unsigned length);
void far cdecl _fsetmem(void far *dest,unsigned length,
char __value);
endif
if !defined(__STRING_H)
void * _Cdecl memchr (const void s, int c, size_t n);
int _Cdecl memcmp(const void *s1,
const void s2, size_t n);
void * _Cdecl memcpy(void *dest, const void *src,
size_t n);
void * _CType memset(void *s, int c, size_t n);
endif
ifdef __cplusplus
}
endif
endif
endif
pragma option -Vo-
define EOF (-1)
define zapeof(i) ((unsigned char)(i))
typedef long streampos;
typedef long streamoff;
_CLASSDEF(ios)
_CLASSDEF(streambuf)
_CLASSDEF(istream)
_CLASSDEF(ostream)
_CLASSDEF(iostream)
_CLASSDEF(istream_withassign)
_CLASSDEF(ostream_withassign)
_CLASSDEF(iostream_withassign)
class _CLASSTYPE ios {
public:
static const long basefield;
static const long adjustfield;
static const long floatfield;
_Cdecl ios(streambuf );
virtual _Cdecl ~ios();
long _Cdecl flags();
long _Cdecl flags(long);
long _Cdecl setf(long _setbits, long _field);
long _Cdecl setf(long);
long _Cdecl unsetf(long);
int _Cdecl width();
int _Cdecl width(int);
char _Cdecl fill();
char _Cdecl fill(char);
int _Cdecl precision(int);
int _Cdecl precision();
ostream * _Cdecl tie(ostream );
ostream * _Cdecl tie();
int _Cdecl rdstate();
int _Cdecl eof();
int _Cdecl fail();
int _Cdecl bad();
int _Cdecl good();
void _Cdecl clear(int = 0);
_Cdecl operator void * ();
int _Cdecl operator! ();
static long _Cdecl bitalloc();
static int _Cdecl xalloc();
long & _Cdecl iword(int);
void * & _Cdecl pword(int);
static void _Cdecl sync_with_stdio();
int _Cdecl skip(int);
protected:
static void _Cdecl (*stdioflush)();
private:
static long nextbit;
static int usercount;
union ios_user_union *userwords;
int nwords;
void _Cdecl usersize(int);
};
inline streambuf * _Cdecl ios::rdbuf() { return bp; }
inline ostream * _Cdecl ios::tie() { return x_tie; }
inline char _Cdecl ios::fill() { return x_fill; }
inline int _Cdecl ios::precision() { return x_precision; }
inline int _Cdecl ios::rdstate() { return state; }
inline int _Cdecl ios::eof() { return state & eofbit; }
inline int _Cdecl ios::fail()
{ return state & (failbit | badbit | hardfail); }
inline int _Cdecl ios::bad() { return state & (badbit | hardfail); }
inline int _Cdecl ios::good() { return state == 0; }
inline long _Cdecl ios::flags() { return x_flags; }
inline int _Cdecl ios::width() { return x_width; }
inline int _Cdecl ios::width(int _w)
{ int _i = x_width; x_width = _w; return _i; }
inline char _Cdecl ios::fill(char _c)
{ char _x = x_fill; x_fill = _c; return _x; }
inline int _Cdecl ios::precision(int _p)
{ int _x = x_precision; x_precision = _p; return _x; }
inline _Cdecl ios::operator void *()
{ return fail() ? 0 : this; }
inline int _Cdecl ios::operator! () { return fail(); }
class _CLASSTYPE streambuf {
public:
virtual _Cdecl ~streambuf();
virtual streambuf * _Cdecl setbuf( signed char *, int);
virtual int _Cdecl do_sgetn(char *, int);
virtual int _Cdecl underflow();
int _Cdecl sputbackc(char);
virtual int _Cdecl pbackfail(int);
int _Cdecl in_avail();
virtual int _Cdecl do_sputn(const char * s, int n);
virtual int _Cdecl overflow(int = EOF);
int _Cdecl out_waiting();
virtual streampos _Cdecl seekoff(streamoff, ios::seek_dir,
int = (ios::in | ios::out));
virtual streampos _Cdecl seekpos(streampos, int = (ios::in | ios::out));
virtual int _Cdecl sync();
protected:
char * Cdecl base();
char * _Cdecl ebuf();
int _Cdecl blen();
char * _Cdecl pbase();
char * _Cdecl pptr();
char * _Cdecl epptr();
char * _Cdecl eback();
char * _Cdecl gptr();
char * _Cdecl egptr();
void _Cdecl setp(char , char );
void _Cdecl setg(char , char , char );
void _Cdecl pbump(int);
void _Cdecl gbump(int);
void _Cdecl setb(char , char , int = 0 );
void Cdecl unbuffered(int);
int _Cdecl unbuffered();
int _Cdecl allocate();
virtual int _Cdecl doallocate();
private:
short alloc;
short unbuf_;
char * base_;
char * ebuf_;
char * pbase_;
char * pptr_;
char * epptr_;
char * eback_;
char * gptr_;
char * egptr_;
int Cdecl do_snextc();
_Cdecl streambuf(streambuf &);
void _Cdecl operator= (streambuf &);
inline char * _Cdecl streambuf::base() { return base; }
inline char * Cdecl streambuf::pbase() { return pbase; }
inline char * Cdecl streambuf::pptr() { return pptr; }
inline char * Cdecl streambuf::epptr() { return epptr; }
inline char * Cdecl streambuf::gptr() { return gptr; }
inline char * Cdecl streambuf::egptr() { return egptr; }
inline char * Cdecl streambuf::eback() { return eback; }
inline char * Cdecl streambuf::ebuf() { return ebuf; }
inline int Cdecl streambuf::unbuffered() { return unbuf; }
inline int Cdecl streambuf::blen() { return (int)(ebuf - base_);}
inline streambuf *
_Cdecl streambuf::setbuf(unsigned char * _p, int _len)
{
return setbuf((signed char )_p, _len); }
inline void _Cdecl streambuf::pbump(int _n) { pptr += n; }
inline void _Cdecl streambuf::gbump(int _n) { gptr += n; }
inline void _Cdecl streambuf::unbuffered(int _unb) { unbuf = (unb != 0); }
inline int _Cdecl streambuf::in_avail()
{ return (egptr > gptr_) ? (int)(egptr_ - gptr_) : 0; }
inline int Cdecl streambuf::out_waiting()
{ return pptr ? (int)(pptr_ - pbase_) : 0; }
inline int Cdecl streambuf::allocate() {
return (base || unbuf_) ? 0 : doallocate();
}
inline int Cdecl streambuf::sgetc() {
return (gptr >= egptr_) ? underflow() :
(unsigned char)(gptr_);
}
inline int Cdecl streambuf::snextc() {
return (! gptr || (++gptr_ >= egptr_)) ?
do_snextc() :
(unsigned char)(gptr_);
}
inline int Cdecl streambuf::sbumpc() {
return (gptr >= egptr_ && underflow() == EOF) ?
EOF :
(unsigned char)(gptr_++);
}
inline void Cdecl streambuf::stossc() {
if( gptr >= egptr_ ) underflow();
else ++gptr_;
}
inline int Cdecl streambuf::sputbackc(char _c) {
return (gptr > eback_) ?
(unsigned char)(--gptr_ = c) :
pbackfail(_c);
}
inline int _Cdecl streambuf::sputc(int _c) {
return (pptr >= epptr_) ?
overflow((unsigned char)c) :
(unsigned char)(*pptr++ = _c);
}
ifdef BIG_INLINE
inline int Cdecl streambuf::sputn(const char * _s, int _n) {
if( _n <= (epptr - pptr_) ) {
memcpy(pptr_, s, _n);
pbump(_n);
return _n;
}
return do_sputn(_s, _n);
}
inline int _Cdecl streambuf::sgetn(char * _s, int _n) {
if( _n <= (egptr - gptr_) ) {
memcpy(s, gptr, _n);
gbump(_n);
return _n;
}
return do_sgetn(_s, _n);
}
endif
class CLASSTYPE istream : virtual public ios {
public:
_Cdecl istream(streambuf );
virtual _Cdecl ~istream();
_Cdecl istream(streambuf , int _sk, ostream * _t=0);
_Cdecl istream(int _sz, char , int _sk=1);
_Cdecl istream(int _fd, int _sk=1, ostream * _t=0);
int _Cdecl ipfx(int = 0);
int _Cdecl ipfx0();
int _Cdecl ipfx1();
void _Cdecl isfx() { }
istream & _Cdecl seekg(streampos);
istream & _Cdecl seekg(streamoff, seek_dir);
streampos _Cdecl tellg();
int _Cdecl sync();
istream & _Cdecl get( signed char , int, char = '\n');
istream & _Cdecl get(unsigned char , int, char = '\n');
istream & _Cdecl read( signed char , int);
istream & _Cdecl read(unsigned char , int);
istream & _Cdecl getline( signed char , int, char = '\n');
istream & _Cdecl getline(unsigned char , int, char = '\n');
istream & _Cdecl get(streambuf &, char = '\n');
istream & _Cdecl get(unsigned char &);
istream & _Cdecl get( signed char &);
int _Cdecl get();
int _Cdecl peek();
int _Cdecl gcount();
istream & _Cdecl putback(char);
istream & _Cdecl ignore(int = 1, int = EOF);
istream & _Cdecl operator>> (istream & (_Cdecl _f)(istream &));
istream & _Cdecl operator>> (ios & (_Cdecl _f)(ios &) );
istream & _Cdecl operator>> ( signed char );
istream & _Cdecl operator>> (unsigned char );
istream & _Cdecl operator>> (unsigned char &);
istream & _Cdecl operator>> ( signed char &);
istream & _Cdecl operator>> (short &);
istream & _Cdecl operator>> (int &);
istream & _Cdecl operator>> (long &);
istream & _Cdecl operator>> (unsigned short &);
istream & _Cdecl operator>> (unsigned int &);
istream & _Cdecl operator>> (unsigned long &);
istream & _Cdecl operator>> (float &);
istream & _Cdecl operator>> (double &);
istream & _Cdecl operator>> (long double &);
istream & _Cdecl operator>> (streambuf );
protected:
_Cdecl istream();
void _Cdecl eatwhite();
private:
int gcount;
signed char Cdecl do_get();
};
inline int _Cdecl istream::gcount() { return gcount; }
inline int _Cdecl istream::ipfx0() { return ipfx(0); }
inline int _Cdecl istream::ipfx1() { return ipfx(1); }
ifdef BIG_INLINE
inline istream & _Cdecl istream::operator>> (unsigned char & _c) {
if( ipfx0() )
_c = bp->in_avail() ? bp->sbumpc() : do_get();
return this;
}
inline istream & _Cdecl istream::operator>> (signed char & _c) {
if( ipfx0() )
_c = bp->in_avail() ? bp->sbumpc() : do_get();
return this;
}
endif
inline istream & _Cdecl istream::operator>> (unsigned char _p) {
return this >> (signed char )_p;
}
inline istream & _Cdecl istream::get(unsigned char _p, int _l, char _t) {
return get((signed char )_p, _l, _t);
}
inline istream & _Cdecl istream::read(unsigned char _p, int _l) {
return read((signed char )_p, _l);
}
inline istream & _Cdecl istream::getline(unsigned char _p, int _l, char _t) {
return getline((signed char ) _p, _l, _t);
}
inline int _Cdecl istream::sync() { return bp->sync(); }
inline istream & _Cdecl istream::operator>> (istream & (_Cdecl _f)(istream &)) {
return (_f)(this);
}
ifdef BIG_INLINE
inline istream & Cdecl istream::get(unsigned char & _c) {
if( ipfx1() )
if( bp->in_avail() ) {
gcount = 1;
c = bp->sbumpc();
}
else _c = do_get();
return this;
}
inline istream & Cdecl istream::get(signed char & _c) {
if( ipfx1() )
if( bp->in_avail()) {
gcount = 1;
_c = bp->sbumpc();
}
else _c = do_get();
return this;
}
inline int _Cdecl istream::get() {
if( ipfx1() ) {
int _c = bp->sbumpc();
if( _c == EOF ) setstate(eofbit);
else gcount = 1;
return _c;
}
else return EOF;
}
endif
inline int _Cdecl istream::peek() { return ipfx1() ? bp->sgetc() : EOF; }
class _CLASSTYPE ostream : virtual public ios {
public:
_Cdecl ostream(streambuf );
virtual _Cdecl ~ostream();
_Cdecl ostream(int _fd);
_Cdecl ostream(int _sz, char );
int _Cdecl opfx();
void _Cdecl osfx();
ostream & _Cdecl flush();
ostream & _Cdecl seekp(streampos);
ostream & _Cdecl seekp(streamoff, seek_dir);
streampos _Cdecl tellp();
ostream & _Cdecl put(char);
ostream & _Cdecl write(const signed char , int);
ostream & _Cdecl write(const unsigned char , int);
ostream & _Cdecl operator<< ( signed char);
ostream & _Cdecl operator<< (unsigned char);
ostream & _Cdecl operator<< (short);
ostream & _Cdecl operator<< (unsigned short);
ostream & _Cdecl operator<< (int);
ostream & _Cdecl operator<< (unsigned int);
ostream & _Cdecl operator<< (long);
ostream & _Cdecl operator<< (unsigned long);
ostream & _Cdecl operator<< (float);
ostream & _Cdecl operator<< (double);
ostream & _Cdecl operator<< (long double);
ostream & _Cdecl operator<< (const signed char );
ostream & _Cdecl operator<< (const unsigned char );
ostream & _Cdecl operator<< (void );
ostream & _Cdecl operator<< (streambuf );
ostream & _Cdecl operator<< (ostream & (_Cdecl _f)(ostream &));
ostream & _Cdecl operator<< (ios & (_Cdecl _f)(ios &));
protected:
int _Cdecl do_opfx();
void _Cdecl do_osfx();
_Cdecl ostream();
private:
void _Cdecl outstr(const signed char , const signed char );
};
inline int _Cdecl ostream::opfx() { return ospecial ? do_opfx() : 1; }
inline void _Cdecl ostream::osfx() { if( x_flags & (stdio | unitbuf) ) do_osfx(); }
ifdef BIG_INLINE
inline ostream & _Cdecl ostream::operator<< (signed char _c) {
if( opfx() )
if( bp->sputc(_c) == EOF ) setstate(badbit);
osfx();
return *this;
}
endif
inline ostream & _Cdecl ostream::operator<< (unsigned char _c) {
return this << (signed char)_c;
}
inline ostream & _Cdecl ostream::operator<< (const signed char * _s) {
outstr(_s, (const signed char )0);
return this;
}
inline ostream & _Cdecl ostream::operator<< (const unsigned char * _s) {
outstr((const signed char )_s, (const signed char )0);
return this;
}
inline ostream & _Cdecl ostream::operator<< (short _i)
{ return this << (long) _i; }
inline ostream & _Cdecl ostream::operator<< (unsigned short _i)
{ return this << (unsigned long) _i; }
inline ostream & _Cdecl ostream::operator<< (int _i)
{ return this << (long) _i; }
inline ostream & _Cdecl ostream::operator<< (unsigned int _i)
{ return this << (unsigned long) _i; }
inline ostream & _Cdecl ostream::operator<< (float _f)
{ return this << (long double) _f; }
inline ostream & _Cdecl ostream::operator<< (double _d)
{ return this << (long double) _d; }
inline ostream & _Cdecl ostream::operator<< (ostream & (_Cdecl _f)(ostream &))
{ return (_f)(this); }
inline ostream & _Cdecl ostream::write(const unsigned char * _s, int _n)
{ return write((const signed char )_s, _n); }
inline ostream & _Cdecl ostream::put(char _c) {
if( bp->sputc(_c) == EOF ) setstate(badbit);
return *this;
}
ifdef BIG_INLINE
inline ostream & _Cdecl ostream::write(const signed char * _s, int _n) {
if( ! fail() )
if( bp->sputn((const char )_s, _n) != _n )
setstate(badbit);
return this;
}
endif
class _CLASSTYPE iostream : public istream, public ostream {
public:
_Cdecl iostream(streambuf );
virtual _Cdecl ~iostream();
protected:
_Cdecl iostream();
};
class _CLASSTYPE istream_withassign : public istream {
public:
_Cdecl istream_withassign();
virtual _Cdecl ~istream_withassign();
istream_withassign & _Cdecl operator= (istream &);
istream_withassign & _Cdecl operator= (streambuf );
};
class _CLASSTYPE ostream_withassign : public ostream {
public:
_Cdecl ostream_withassign();
virtual _Cdecl ~ostream_withassign();
ostream_withassign & _Cdecl operator= (ostream &);
ostream_withassign & _Cdecl operator= (streambuf );
};
class _CLASSTYPE iostream_withassign : public iostream {
public:
_Cdecl iostream_withassign();
virtual _Cdecl ~iostream_withassign();
iostream_withassign & _Cdecl operator= (ios &);
iostream_withassign & _Cdecl operator= (streambuf );
};
extern istream_withassign _Cdecl cin;
extern ostream_withassign _Cdecl cout;
extern ostream_withassign _Cdecl cerr;
extern ostream_withassign _Cdecl clog;
ostream & _Cdecl endl(ostream &);
ostream & _Cdecl ends(ostream &);
ostream & _Cdecl flush(ostream &);
ios & _Cdecl dec(ios &);
ios & _Cdecl hex(ios &);
ios & _Cdecl oct(ios &);
istream & _Cdecl ws(istream &);
pragma option -Vo.
endif
/-----------------------------------------------------------/
copy that into a text file and save it as iostream.h but put it in a diff folder from everything else
and put this code on a other text file and run it
/-----------------------------------------------------------/
include<iostream.h>
int main(){
cout<<"Iostream";
return(0);
}
/-----------------------------------------------------------/