Monday, May 24, 2010

Need help in C languauge?

C SKILL SET











1.How do you write a program which produces its own source code as its output?


2.How can I find the day of the week given the date?


3.Why doesn't C have nested functions?


4.What is the most efficient way to count the number of bits which are set in a value?


5.How can I convert integers to binary or hexadecimal?


6.How can I call a function, given its name as a string?


7.How do I access command-line arguments?


8.How can I return multiple values from a function?


9.How can I invoke another program from within a C program?


10.How can I access memory located at a certain address?


11.How can I allocate arrays or structures bigger than 64K?


12.How can I find out how much memory is available?


13.How can I read a directory in a C program?


14.How can I increase the allowable number of simultaneously open files?


15.What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?

Need help in C languauge?
Wow, that's a lot of questions.


1) If you want to cheat, you just read the .c file and display it. To convert an .exe file to source code, you'll need to learn Assembly language. You will have to disassemble the .exe file and then translate the disassembled code to .c source.


2) You can figure out how to do that programmatically if you look at a calendar.


3) You can call other functions within functions, but doing anything else is inefficient.


4) Hint: Learn how binary numbers work and make use of the boolean algebra operators.


5) Learn how to convert binary and hexadecimal numbers into decimal, and then you can figure out the code to do the conversion programmatically. You can also view the documentation on the standard C libraries - some functions can do this for you.


6) Why would you want to do that? That's just stupid. It's possible to do that programmatically, but all that additional code is ridiculous.


7) Look in your compiler's documentation regarding main().


8) Create a structure and make your function so that it accepts a pointer to your structure as an argument. Your function then just fills in the structure members.


9) That depends on the operating system. Read the documentation on the functions that reside in your compiler's libraries. Your compiler might have the spawn() function. If you're working in DOS, then you might have an Exec function if your compiler comes with a DOS library.


10) Initialize a pointer with your specific memory address. Then you just access the memory that the pointer variable points to as you normally do.





Near Pointer:


unsigned char *video=2334; /* offset 2334 */





Far Pointer:


unsigned char far *video=(char *) 0xa0000000; /* segment A000, offset 0 */





11) Some 16 bit compilers support the 'huge' data type. However, the machine code that is produced to access 'huge' data is inefficient. It is better to just split your arrays if they exceed 64k.


12) See answer 9.


13) See answer 9.


14) See answer 9.


15) You're missing the ';' character at the end of the line, and you didn't allocate a variable of the 'FILE' structure type and specify it in the fopen() line. Stream functions require the 'FILE' structure. Also, you didn't put an extra '\' character after the '\' slashes in your string.


Example:


FILE *in;


in = fopen( "c:\\myfile.txt", "r");
Reply:Any Problem Ask An Expert And Get Professional Help


at


http://directcegree.info


http://www.geocities.com/programinghelps
Reply:2)using while statement


3)who said c have nested function ex if else


4)using arrays


5)using string arrays


6)call simply by mentioning the name


7)/*--------------*/


8)using recursion function.


9)i think thats not available in c


10)using pointers


11)use dyanamic arrays


12)dont know

yu gi oh cards

No comments:

Post a Comment