Solved

C and stdin

Posted on 2001-08-01
5
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 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