943,922 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 8040
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 26th, 2004
1

Preparing for an interview and need some questions answered

Expand Post »
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"
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
Dwija is offline Offline
1 posts
since Jan 2004
Mar 23rd, 2004
1

Re: Its important,Plz hlp

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
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 27th, 2004
1
Re: Preparing for an interview and need some questions answered
I disagree C does have nested functions...recursion is pretty nested to me.
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004
Mar 27th, 2004
0

Re: Its important,Plz hlp

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.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 27th, 2004
1

Re: Preparing for an interview and need some questions answered

ummm... are we sure this is an interview? This sounds more like a homework assignment to me... Who's doing the interviewing?
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Mar 27th, 2004
0

Re: Its important,Plz hlp

Quote 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:
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004
Mar 27th, 2004
0

Re: Its important,Plz hlp

exactly.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 28th, 2004
1

Re: Preparing for an interview and need some questions answered

Infamous, you have better things to do than waste your time doing someone else's homework.
Team Colleague
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
samaru is offline Offline
1,227 posts
since Feb 2002
Mar 28th, 2004
0

Re: Preparing for an interview and need some questions answered

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.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 28th, 2004
0

Re: Preparing for an interview and need some questions answered

well it helped me at least, now I know what a nested function is
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Developing, building, and testing. How do it the best? Learning from the world leader
Next Thread in C Forum Timeline: List Catagories





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC