Solved

C and stdin

Posted on 2001-08-01
5
196 Views
Last Modified: 2010-04-21
why Can't i do this, compiler just hiss a fit
FILE*  fsomething={stdin};
and why is LINUX flex is spitting out information completely different form UNIX lex.  SAME FILE, same makefile  two different outputs,  one is 600 lines --- UNIX and the other is 1686--> linux
I got points to give, so I can award two-2-three folks so don't be SHY
0
Comment
Question by:shakashoya
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6342422
flex is the GNU version of AT&T's lex.
To get rid of all the features/enhancements/improvements/performance of flex, and get a lex compatible output, use the -l option. Be warned, read    man flex  befor.
0
 
LVL 4

Expert Comment

by:sdussinger
ID: 6342508
What kind of error are you getting with the stdin? I compiled both:

FILE *f = stdin;

and

FILE *f = {stdin};

with no problems. I'm using Mandrake 7.2/gcc 2.95.3...

Can you post the actual error you get?

--Steve
0
 
LVL 6

Expert Comment

by:graham_k
ID: 6343572
you might want to try freopen()
0
 
LVL 5

Accepted Solution

by:
garboua earned 100 total points
ID: 6375883
lex and flex the chicken and the egg.
well "-l" by itself is not going to give you old standard , unix lex.  there are so many other option you will have to specify to go back.  Why don't you read on flex  and modify the input code so it will produce the output that you want.  

the idea of gcc is a new free for all compiler, so where did we go wrong?  who know.  in Theory FILE* should take the assignment just like U wanted, but  oh well.  I did not try it on my modifed RH 2.96, not standard release, but should work.
0
 

Author Comment

by:shakashoya
ID: 6383683
POINTS TIME
for ahoffmann
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=linuxprog&qid=20168184
thanx for help
for garboua
thanx for help
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now