C Programming Quiz
This quiz consists of 20 multiple-choice questions. Please use the answer sheet at the end to enter the appropriate answer for each question (T, F, A, B, C etc).
...
How to verify user input is number in C?
Hi there,
I have a problem trying to generate the pyramid below using nested loops:
----------1
---------232
--------34543
-------4567654
------567898765
-----67890109876
----789012...
I'm tweaking a program that requires that I raise an integer to the power of a fraction: 3 ^ 1.4, etc.
The problem is that I cannot use the standard math.h pow() function as I'm having too ...
I am trying to load a PNG file at runtime into a dialog. I read that VS 2008 is able to do this, but must be done programmatically. I have the file in the resource editor, IDB_IMAGE and the ...
I'm trying to start programming in C, and I have some sample source code that I know should be good. It is in the code section below.
When I try to compile it using MinGW, using the command...
Hello There,
I would like to validate the user input as numerical only. Range between 1 and 1000 inclusif. I need to use a loop to validate this input.
As long as the user has entered a...
1. The while looping structure can be used in a C program __________.
A) when the number of repetitions is known in advance.
B) as a pre-test counting controlled loop.
C) as a pre-test c...
Hi
I have a char array
char m_string [20];
that contains a set of 9 digits 012345678
Is there any way I can add a hyphen into the string to get 012345-678 ?
The hyphen will always be ...
Hello,
I am supposed to read data from file to buffer then transmit this data.
I use the following:
char buf[1024];
fd = open("file1.txt", O_RDWR | O_NONBLOCK);
read...
Hi ,
i have written an Video application which uses WebCam.
Works fine!!!
but i wonder how to check the availability of the WEBCAM. i.e status if present or Not present or Busy???
us...
Hello,
Can someone explain me why do i get the following warnings ?
Thanks in advnace for any help !
1. Declare three character type arrays.
2. Use two arrays to take input from user.
o Take input as char type.
o Take 10 values in each array.
3. Merge both these input arrays.
o If a...
For some reason my program keep crashing when it is time to free memory that was allocated by strdup. Can somebody determine what I am doing wrong?
Hi,
Have been trying to get to grips with both C and BerkeleyDB recently, being a newbie to both.
Wrote my first callback today (below), but during compiling I get the following
erro...
I try to read data from a text file into a two-dimensional array in c++.
There are 8 tab seperated column and 5000 rows of integers (shorts).
When I run the code below the b counter is m...
Hi,
I'd like to know how to pass a string to a function by reference.
e.g.
main()
{
char * string;
myfunction(string);
}
myfunction(string)
{
//modify string and send back to...
I am writing a simple shell program for unix that 1) takes a command from a user via standard input, 2) parses the command into a data structure, 3) parses the PATH environment, 4) looks up th...
I need help with my C prpgramming. I need to read ch by ch from a text file and store each word into a global array. The file will only contain white space or endline.
Thanks
The text fi...
Hi all,
I want to work My application in Non-english Os.
As of now , my application follow ISO-8859-1 encoding.For I18N, i m going to change UTF-8.
My dought is , part of my applicati...
Typical programme question is like this
..............a program which prompts the user to enter an integer (in the range 1-8)determ...
Hi,
Could anyone pls tell me what this means..It seems like the size of the array has not properly allocated? thanks a million
Address 0x1B91D1C0 is 0 bytes after a block of size 8 allo...
Hello all,
I am trying to debug a dll i have received to maintain. This dll is loaded as a hook and reads socket info with iexplore.exe. However i get a memory read error which is intermitt...
Hi,
I am trying to write program for API of rpm (rpm5.org). I added library for it. And wrote sample program by including #include <rpm/rpmlib.h>.
I am getting following error while comp...
Hello,
I define typedef enum. Then define parameter from this type.
What would happen If i am trying to set an unillegal value to this parameter? What value would it get?
Is there any way...