LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to write the compiler source code (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-write-the-compiler-source-code-4175433063/)

durgam anil 10-18-2012 10:40 PM

how to write the compiler source code
 
one day before i am given one interview in that they asked question like this
question:the marvel written the source code with out proper intendation.you have to write a c/c++ code for take a source file and when you got open brace then next line should be some tab after and also if ,else and while after one tab space..??
please any one help me how to write a c code..

how to write the compiler source code??

rtmistler 10-19-2012 02:10 PM

You do realize that the interview was to find out if you know how to do that on your own?

Just to also clarify, I don't think they were asking for compiler code, they were asking for a parser and reformatter which would take something like:

int main(int argv,char**argv){int i;if(argv<2){printf("Usage:...\n");return -1;}i=argv[1];printf("Argument: %d\n,i);return 0;}

And reformat it so that it was spatially readable within the guidelines of a coding style document.

They're also likely looking for how you approach that problem intellectually. What's your first "take" on the problem, what questions do you have about the task you're being asked to complete, and how fast you "get" their whole point.

Yes, some interview questions are stupid, pointless, or a pet peeve of the questioner; in fact many of them are self serving. But if you claim to have mastery of the C-language, then .... they're likely going to ask you touch C-language questions. And if you claim to know it a bit, then they're likely still going to ask you C-language questions so they can see how much you do know.

If you're really interested in learning the language better, read up on references. Take this interview as a learning experience, go further and ask what they are looking for really, and do your own experimentations so that you actually learn the language by using it. Doing just "Hello World" does not mean you know C, and I'm not saying that you don't know it at all, just saying that this interviewer is trying to gage your knowledge as best as they can and they likely have several candidates. (I always thought the proper spelling was gauge, but the spell checker told me 'no')

durgam anil 10-19-2012 03:48 PM

device drivers
 
i have drivers lab 2.6.34.12. tar file.
i extracted the file.when i am installing that it is asking the .config file..i am not understand the why the .config file..is it the necessary.if any one having the config file and drivers lab tar file please share the link and how to install on the open suse 12.1

and also

how to install glut(graphics library) in open suse.
please tell me the the basic book for learn graphics programming for beginners.

resetreset 10-20-2012 02:27 PM

Quote:

Originally Posted by durgam anil (Post 4810238)
please tell me the the basic book for learn graphics programming for beginners.

Michael Abrash's Graphics Programming Blackbook is my favourite gfx. book of all time. It's available for free on the net.
It dates back to DOS days, so you'll probably have to find an old machine from somewhere.

durgam anil 10-21-2012 12:57 AM

how to install glut in the open suse please any help me..

knudfl 10-21-2012 08:59 AM

# 5 : Suse 12.1 ..

1) su
2) zypper in freeglut-devel

durgam anil 11-14-2012 12:44 PM

i am downloaded avr8-gnu-toolchain-linux-x86 file and i extracted the file.but i unable to compile the files.when i am giving make command it is not working..please help me how to work with avr dude. and tel me x86 avr works on 32bit linux.

durgam anil 11-14-2012 12:50 PM

sensor node code in c language
 
1 Attachment(s)
please help me how to do the sensor node code in c language ..give me guidance.

in a sensor node having micro controller ,adc,power supply,external memory and physical sensors

durgam anil 11-14-2012 01:25 PM

sensor node code in c language
 
1 Attachment(s)
this is sensor blocks code in c language i unable to compile this code in with the my avr tool chain so please any one help to what is the steps to make the avr toolchain to work..


All times are GMT -5. The time now is 09:38 PM.