| | |
Preparing for an interview and need some questions answered
![]() |
•
•
Join Date: Jan 2004
Posts: 1
Reputation:
Solved Threads: 0
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"
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"
•
•
Join Date: Mar 2004
Posts: 77
Reputation:
Solved Threads: 2
1) b/c C is a minimal, spartan like language
2) shift each bit out and test it:
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
2) shift each bit out and test it:
C Syntax (Toggle Plain Text)
unsigned int num = 0xdeadbeef; for(int x = 0; x < (sizeof(int) * 8); x++) if(num & (1 << x) ) printf("bit %d is on\n", x);
#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
•
•
•
•
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.
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
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
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.
![]() |
Similar Threads
- Preparing for IT Interview - Interview Questions (IT Professionals' Lounge)
Other Threads in the C Forum
- Previous Thread: Developing, building, and testing. How do it the best? Learning from the world leader
- Next Thread: List Catagories
| Thread Tools | Search this Thread |
* adobe ansi api array asterisks binarysearch calculate centimeter changingto char cm convert copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory fflush file fork forloop frequency givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hacking highest histogram homework i/o inches infiniteloop input interest iso kernel keyboard km linked linkedlist linux linuxsegmentationfault list locate looping loopinsideloop. lowest match microsoft mqqueue mysql number open opendocumentformat owf pattern pdf performance posix power probleminc process program programming pyramidusingturboccodes radix read recv repetition research reversing scanf scheduling segmentationfault send sequential socket socketprograming stack standard string systemcall threads turboc unix user variable voidmain() wab whythiscodecausesegmentationfault win32api windows.h windowsapi






