Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C and stdin

Posted on 2001-08-01
5
Medium Priority
?
217 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 400 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

916 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