Solved

C and stdin

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trying to use two loops in a perl script but not getting results need. 10 99
Prestashop 1.5 Redirect Problem 1 124
yum remove leaves empty directories 1 94
KVM vs  Qemu 4 119
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

763 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