Preparing for an interview and need some questions answered

Reply

Join Date: Jan 2004
Posts: 1
Reputation: Dwija is an unknown quantity at this point 
Solved Threads: 0
Dwija Dwija is offline Offline
Newbie Poster

Preparing for an interview and need some questions answered

 
1
  #1
Jan 26th, 2004
Hello
Members/Administrator

I urgently needed help for the following questions as
i have very little time in my hand for preparing the interview.

->Why doesn't C have nested functions?
->What is the most efficient way to count the number of bits which are set in a value?
->How can I call a function, given its name as a string?
->How can I return multiple values from a function?
->How can I invoke another program from within a C program?
->How can I access memory located at a certain address?
->How can I allocate arrays or structures bigger than 64K?
->How can I find out how much memory is available?
->How can I read a directory in a C program?
->How can I increase the allowable number of simultaneously open files?
->What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?


its
"dwija"
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 77
Reputation: infamous is an unknown quantity at this point 
Solved Threads: 2
infamous infamous is offline Offline
Junior Poster in Training

Re: Its important,Plz hlp

 
1
  #2
Mar 23rd, 2004
1) b/c C is a minimal, spartan like language
2) shift each bit out and test it:
  1. unsigned int num = 0xdeadbeef;
  2. for(int x = 0; x < (sizeof(int) * 8); x++)
  3. if(num & (1 << x) ) printf("bit %d is on\n", x);
3)using the `stringification' operator in a preprocessor macro:
#define(func2call) #func2call()
4)by passing some arguments by reference, or by returning a structure packed full of stuff
5)by using execve() or CreateProcess()
6)by dereferencing a p ointer to that address
7)the only limit on dynamically allocated memory is the size of ur RAM i believe
8)see above
9)by using the readdir() function
9)by suing the setrlimit() function in linux
10)looks fine to me
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru
 
1
  #3
Mar 27th, 2004
I disagree C does have nested functions...recursion is pretty nested to me.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 77
Reputation: infamous is an unknown quantity at this point 
Solved Threads: 2
infamous infamous is offline Offline
Junior Poster in Training

Re: Its important,Plz hlp

 
0
  #4
Mar 27th, 2004
that's not what 'nested' functions means. nested functions means being able to define a function inside another. and some compilers allow and others dont, so it's not something u can rely on.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Preparing for an interview and need some questions answered

 
1
  #5
Mar 27th, 2004
ummm... are we sure this is an interview? This sounds more like a homework assignment to me... Who's doing the interviewing?
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Its important,Plz hlp

 
0
  #6
Mar 27th, 2004
Originally Posted by infamous
that's not what 'nested' functions means. nested functions means being able to define a function inside another. and some compilers allow and others dont, so it's not something u can rely on.
oh, i see. Sounds like java, main is inside another class method, is that a correct analogy?

maybe the interview is a homework assignment :lol:
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 77
Reputation: infamous is an unknown quantity at this point 
Solved Threads: 2
infamous infamous is offline Offline
Junior Poster in Training

Re: Its important,Plz hlp

 
0
  #7
Mar 27th, 2004
exactly.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 1,135
Reputation: samaru is just really nice samaru is just really nice samaru is just really nice samaru is just really nice 
Solved Threads: 5
Team Colleague
samaru's Avatar
samaru samaru is offline Offline
a.k.a inscissor

Re: Preparing for an interview and need some questions answered

 
1
  #8
Mar 28th, 2004
Infamous, you have better things to do than waste your time doing someone else's homework.
Check out my blog at http://www.shinylight.com for more stuff about web dev.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 77
Reputation: infamous is an unknown quantity at this point 
Solved Threads: 2
infamous infamous is offline Offline
Junior Poster in Training

Re: Preparing for an interview and need some questions answered

 
0
  #9
Mar 28th, 2004
what am i, psychic? i didnt know if it was homework or not, i was just trying to clear up some of the old posts; worry about yourself. that post was almost 3 months old anyhow, dont think it helped him much if it was homework.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 7
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Preparing for an interview and need some questions answered

 
0
  #10
Mar 28th, 2004
well it helped me at least, now I know what a nested function is
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC