Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: detecting ASCII/EBCDIC

Reply
Thread Tools

Re: detecting ASCII/EBCDIC

 
 
Antoninus Twink
Guest
Posts: n/a
 
      09-02-2008
On 2 Sep 2008 at 22:11, Pilcrow wrote:
> Is there a way that a proram can detect whether it is operating in an
> ASCII or an EBCDIC environment?


#include <stdio.h>
#include <time.h>

int main(void)
{
time_t t;
time(&t);
if(gmtime(&t)->tm_year > 75)
puts("ASCII!");
return 0;
}

 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      09-03-2008
On 2 Sep, 23:25, Antoninus Twink <(E-Mail Removed)> wrote:
> On 2 Sep 2008 at 22:11, Pilcrow wrote:


> > Is there a way that a proram can detect whether it is operating in an
> > ASCII or an EBCDIC environment?

>
> #include <stdio.h>
> #include <time.h>
>
> int main(void)
> {
> time_t t;
> time(&t);
> if(gmtime(&t)->tm_year > 75)
> puts("ASCII!");
> return 0;
> }


despite what twink implies I believe EBCDIC machines do still
exist. The IBM mainfram world is still alive and well.


--
Nick Keighley
 
Reply With Quote
 
 
 
 
Richard
Guest
Posts: n/a
 
      09-03-2008
Nick Keighley <(E-Mail Removed)> writes:

> On 2 Sep, 23:25, Antoninus Twink <(E-Mail Removed)> wrote:
>> On 2 Sep 2008 at 22:11, Pilcrow wrote:

>
>> > Is there a way that a proram can detect whether it is operating in an
>> > ASCII or an EBCDIC environment?

>>
>> #include <stdio.h>
>> #include <time.h>
>>
>> int main(void)
>> {
>> time_t t;
>> time(&t);
>> if(gmtime(&t)->tm_year > 75)
>> puts("ASCII!");
>> return 0;
>> }

>
> despite what twink implies I believe EBCDIC machines do still
> exist. The IBM mainfram world is still alive and well.


Yes. But one has to wonder how many routines written by people looking
for help here will end up running on them....
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting end of file for VHDL'93 Gary Thorpe VHDL 2 07-12-2005 07:42 AM
Detecting if Mozilla is Running Peter Firefox 1 04-30-2005 09:47 PM
Detecting edge in a clock synchronous porcess Praveen VHDL 2 04-12-2005 11:36 AM
Detecting of 'U' in a std_logic_vector Thomas Reinemann VHDL 4 11-03-2004 08:24 AM
detecting if program is running under X windows or not Paul Faulstich Perl 1 01-10-2004 07:16 PM



Advertisments