Solved

C and stdin

Posted on 2001-08-01
5
201 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
low latency kernel configuration 3 174
specifying dependencies for an rpm 2 44
updating the repos in yum 4 111
Linux Scripting 3 103
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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

22 Experts available now in Live!

Get 1:1 Help Now