You are here:
| Subject | Date Asked |
| Random number always the same. | 1/6/2012 |
| Q: For some reason I couldn't follow up with the previous question so I had to make a new one. I'm not ... A: You see the same value for infected because of this statement: infected = rand()<=Inv_NumofBees ... | |
| Error whilst updating a file | 1/5/2012 |
| Q: ) I have encountered one final problem with another function in which I need to update my Inventory ... A: Every time you call rand() you get a new random number. I thought that was what you wanted. I guess ... | |
| Error whilst updating a file | 1/5/2012 |
| Q: ) I have encountered one final problem with another function in which I need to update my Inventory ... A: You are getting random data in the file because you are not initializing the Inv_ variables. You ... | |
| Reading a specific line in a textfile and later updating it. | 1/4/2012 |
| Q: I have a textfile containing the following information: Total number of Bees: 15 Total number of ... A: In the line which prints to the file you have: Inv_Money-price*numofbees price is a float, so the ... | |
| Reading a specific line in a textfile and later updating it. | 1/4/2012 |
| Q: I have a textfile containing the following information: Total number of Bees: 15 Total number of ... A: At this part: if (fscanf(file, LINE_1, &Numofbees) != 1) /*Checks for the number of bees and the ... | |
| Reading a specific line in a textfile and later updating it. | 1/3/2012 |
| Q: I have a textfile containing the following information: Total number of Bees: 15 Total number of ... A: I'll show you how to read and write the file in C, and I'll let you work on the program calculation ... | |
| Memory allocation | 12/20/2011 |
| Q: I am facing segmetation fault in c program. I am suspecting below piece of code. char **name = ... A: The code you sent me would not cause a seg fault on its own, but I suspect it has some problems. ... | |
| c | 12/9/2011 |
| Q: 3)sir my doubt is about extern storage class.”when we have a global variable defined in one c ... A: You may have gotten the 35 output because you included 1.c into 2.c. That is not how to do it. You ... | |
| Help with pseudocode question | 12/8/2011 |
| Q: need help with the following question in pseudocode: Design a program that uses the following ... A: I see your assignment, but I don't see your question. What is it about your assignment that you are ... | |
| c question | 12/2/2011 |
| Q: am gettin error when i try to read float type data in array of structures.. the program terminates ... A: When I tested your program. It worked well as long as I gave it correct input. If it was asking for ... | |
| c | 12/1/2011 |
| Q: My doubt is about variable declaration and definition. Int a ; it is declaration of a .no memory ... A: When you say int a; it is both declaration and definition, and memory IS allocated for the a. When ... | |
| C programing and data structures | 12/1/2011 |
| Q: write a c program to add all numbers between 100 and 200 that contain the digit 5. A: Here is a hint about how to do it. Create a 'for' loop which counts from 100 to 200 Within the for ... | |
| Follow up - C Function to work in larger program | 11/28/2011 |
| Q: Zlatko. Thanks you for responding to me so quickly. The sample program worked great. However when I ... A: The problem is in the main loop. The comments with my initials (ZM) below explain it. Its a very ... | |
| c storage minimal space | 11/28/2011 |
| Q: How can i do the following in C: in order to store the string "abcd", i may need 5 bytes( 40 bits). ... A: It's an interesting question. I may be off by 1 here and there in my analysis below, but I hope you ... | |
| C - Help with finding duplicates in array | 11/27/2011 |
| Q: Good evening, I hope that you might be able to help me with this. I have a program that finds ... A: I would do it like this. Put the checking logic into its own function. The checking function will ... | |
| Here I let you the program,I really need help before tomorrow...THANK YOU | 11/25/2011 |
| Q: I'm sorry I thought I sent you the message,maybe I did something wrong. Thank you anyway for your ... A: Very well, then you should be starting with one parent and one child, and you should get that ... | |
| Here I let you the program,I really need help before tomorrow...THANK YOU | 11/25/2011 |
| Q: I'm sorry I thought I sent you the message,maybe I did something wrong. Thank you anyway for your ... A: What is your program supposed to do? I think this is what you want: The child1 reads a message from ... | |
| Here I let you the program,I really need help before tomorrow...THANK YOU | 11/25/2011 |
| Q: I'm sorry I thought I sent you the message,maybe I did something wrong. Thank you anyway for your ... A: I promise to take a closer look at your program tonight when I have time. For now I have 2 concerns. ... | |
| output of a program. | 11/23/2011 |
| Q: sir, please give me output of following code:- int *a, b=30; &b=1000; a=&b; b=b-5; *a=*a+b; *a=b-10; ... A: You need to trace through the program line by line and write down what is happening. For example: ... | |
| output of a program. | 11/23/2011 |
| Q: sir, please give me output of following code:- int *a, b=30; &b=1000; a=&b; b=b-5; *a=*a+b; *a=b-10; ... A: The code is incorrect. You cannot say &b=1000; It is like saying "the address of b is 1000". The ... | |
| c | 11/23/2011 |
| Q: i know the storage classes.but i am not able to identify the difference between life and scope of a ... A: In C all variables are either local or global. Global variables are ones which are declared ... | |
| Regarding program | 11/22/2011 |
| Q: I want to ask a question regarding a program.Please help me out of this.i want you to resolve this ... A: If you have 2 expressions, separated by a comma, like this: e1,e2 the program first evaluates e1, ... | |
| C arrays | 11/12/2011 |
| Q: I have a problem and I don't know how to explain it. I have a projects and it uses a -1 index, like ... A: It's possible to have a -1 index. The compiler will accept it but it is not a good idea. I would say ... | |
| Making a character bright in C | 10/31/2011 |
| Q: I have a problem in C. I am coding a menu driven program that has four options in the main menu: Add ... A: There is no specific way of doing this in C or C++. It will depend on the operating system you are ... | |
| c | 10/30/2011 |
| Q: Sir #error is used to display user defined messages during compilation of a programme. This is my ... A: The purpose of #error is to tell the programmer that some condition necessary for compiling has not ... | |
| Fibonacci Sequence | 10/23/2011 |
| Q: How to print Fibonacci Sequence using loop and function? Can I install Turbo C/C++ on Windows 7? Is ... A: I've made a video for you to show you how to get started with Visual Studio. I'm sure you can find ... | |
| Fibonacci Sequence | 10/22/2011 |
| Q: How to print Fibonacci Sequence using loop and function? Can I install Turbo C/C++ on Windows 7? Is ... A: I don't know anything about how to find or install turbo C. I do know that it is a very old compiler ... | |
| How to represent a bit in C? details below? | 10/20/2011 |
| Q: you can represent a byte with a type char and for a word(32 bits) with an int. Is there any way you ... A: There is no datatype that is 1 bit long, but there is a way to split a short or int into regions ... | |
| Help with developing my skills C | 10/17/2011 |
| Q: I am an electrical engineer, currently working in th einformation security field, I know much about ... A: For UNIX programming and UNIX network programming, I highly recommend the books by Richard Stevens ... | |
| program in c | 10/10/2011 |
| Q: Write a program in C using only loops to print 1 121 12321 1234321 ... A: If you are having trouble with this, then try to solve a simpler problem. Once you have the simpler ... | |
| c | 10/1/2011 |
| Q: sir my doubt is about .exe file stages in c.these are the stages in .exe file creation.i have read ... A: I can help you see some of the stages. How to do so depends on the compiler you are using. I use two ... | |
| Deleting all C: files on ones Windows XP pc | 9/30/2011 |
| Q: "system" call to delete files: I have a pc with windows XP; consider the following six line C code: ... A: Your idea to delete all the files on the C drive will probably not work for a number of reasons. ... | |
| C language | 9/28/2011 |
| Q: What is the output of the statement printf("%c","abcdef"); How & Why? A: In C, any text in quotes is a string. The string is a sequence of bytes in memory. Any text in ... | |
| Core Dump | 9/28/2011 |
| Q: This is Lakshmipathy. I am facing segmentation fault one of C++ library. When i have tried to debug ... A: It is impossible to know the reason for the core dump without seeing the code. Core dumps often ... | |
| c | 9/26/2011 |
| Q: sir thanks for your concern about,my doubts. todays my doubt is about tress. what is meant by ... A: Look at this picture http://en.wikipedia.org/wiki/File:Sorted_binary_tree.svg The in-order ... | |
| convert decimal to computational field of cobol using c | 9/13/2011 |
| Q: the computational field in cobol saves a number in binary but in compressed form i.e. +999 or -999 ... A: In C and C++ integers are stored as binary data. It is different from cobol where numbers are stored ... | |
| Unexpected Output | 9/11/2011 |
| Q: I have a problem in C File I/O program. The part where the problem lies is given below: void ... A: I think the problem is that the mobile field in the member_data and list_data is too short. The char ... | |
| Unexpected Output | 9/10/2011 |
| Q: I have a problem in C File I/O program. The part where the problem lies is given below: void ... A: It is difficult to say what the problem might be without seeing the other function. Check to make ... | |
| c++/oop | 9/5/2011 |
| Q: I wrote this program to reverse a string using dynamic constructor concept but this shows a garbage ... A: The first problem with the code is here: rstring obj1,obj2; obj1.rev(); Notice that you are ... | |
| double pointer behaviour | 8/24/2011 |
| Q: Please find the following code snippet. int arr[3][4] = {10,20,30,40,50,60,70,80,90,100,110,120}; ... A: That is a good question. The code happens to work for integers, but if you change it to shorts, you ... | |
| Explaining NULL | 8/19/2011 |
| Q: How to explain NULL to students since they donot get the concept of strings,and ask about their real ... A: The idea of NULL should be no more difficult than the idea of zero or nothing. Don't make it seem ... | |
| logic degsin | 7/21/2011 |
| Q: 1.Draw the circuit for 3-to-8 line decoder. A: What is the truth table for a three to 8 decoder? You have 3 inputs, A, B, C, and 8 outputs Q1 ... | |
| c | 7/20/2011 |
| Q: 2. Write an algorithm to find the bus fare based on distance traveled as per the following rates: ... A: The linear cost is one way of interpreting the problem. If your algorithm is one equation, then the ... | |
| c | 7/20/2011 |
| Q: How AND gate can be realized using NOR gate?" A: You have 2 signals, A,B and you want A * B but you have only NOR gates. A NOR B is !(A + B) where I ... | |
| c | 7/20/2011 |
| Q: 2. Write an algorithm to find the bus fare based on distance traveled as per the following rates: ... A: The algorithm is the hard part. The flowchart is just translating it into a picture. I don't have a ... | |
| c | 7/19/2011 |
| Q: 2. Write an algorithm to find the bus fare based on distance traveled as per the following rates: ... A: Well, how about this: cost = 5 distance = distance - 2 while distance > 0 do cost = cost + 2.50 ... | |
| string handling problem | 7/8/2011 |
| Q: i have a question to solve....where i am suppose to enter n number of set of names and then m number ... A: That is great! You must be using the GNU gcc compiler. I have read that the latest C standard allows ... | |
| string handling problem | 7/7/2011 |
| Q: i have a question to solve....where i am suppose to enter n number of set of names and then m number ... A: You have not really told me what part you are having trouble with. I am happy to help you but I ... | |
| c doubt | 7/1/2011 |
| Q: main() { printf("%c","abcdefgh"[4]); } output: e sir how the above code works?how e comes as out ... A: It works like this. x is not less than y, so x<y returns false or 0. 0 is less than z, so 0<z ... | |
| c doubt | 7/1/2011 |
| Q: main() { printf("%c","abcdefgh"[4]); } output: e sir how the above code works?how e comes as out ... A: This question is similar to your first question. There is some pointer pointing to the text ... | |
| c doubt | 7/1/2011 |
| Q: main() { printf("%c","abcdefgh"[4]); } output: e sir how the above code works?how e comes as out ... A: The compiler puts the text "abcdefgh" somewhere in memory, and in the printf line the compiler ... | |
| C Language | 6/30/2011 |
| Q: The main() function is predefined or userdefined. if main() is userdefined function then we can not ... A: The main function is one which you define. In C, the word "define" means to provide an ... | |
| merge one arraye's items | 6/26/2011 |
| Q: I have a big problem I don't know what should I do when I want to merge 2 or more items of a array ... A: I understand you want to merge array B into array A. Most important is to decide if array A has ... | |
| c++ programming | 6/20/2011 |
| Q: respected sir, please kindly reply me to print the following pattern in c++ using nested while ... A: How about I give you a hint, then you try to finish the program, and if you have trouble, show me ... | |
| return value iv c | 6/19/2011 |
| Q: arguments and return value stored on stack frame of every function. right..? as shown in the ... A: Variables like int and char and float are copied onto the stack when they are returned and then ... | |
| pointer in ANSI C | 6/19/2011 |
| Q: I am quite weak in pointer for C language. Could you please explain to me this coding? #include ... A: Before I get to your question, I want to make sure you understand how the string "Hi" is being ... | |
| question of c programming | 6/15/2011 |
| Q: What does the following fragment of C-program print? char c[]="GATE2011"; char *p =c; printf("%s", ... A: In this program, p[3] is 'E', and p[1] is 'A'. The ASCII character code for 'E' is 69, and for 'A' ... | |
| exit(0) & exit(1) | 6/5/2011 |
| Q: Sir, Can you please explain the difference between exit(0) and exit(1)with one example. Both will ... A: You are correct that both versions of exit terminate the program. The exit(0) or exit(EXIT_SUCCESS) ... | |
| creating a GUI for my program on ms visual studio | 5/31/2011 |
| Q: Glad you are back!:) Everybody said you could help me better with this. I have a program in c++ ... A: Please send me your visual studio project files to xxxxxxxxxxxxxxxxxx and I'll try to look at it in ... | |
| Functions | 5/31/2011 |
| Q: Hi though main() is userdefined function if we shouldn't spell correctly why compiler generates an ... A: Your linker expects a main function because that is the entry point of your program. If you misspell ... | |
| Sir, Please send the reason for the output | 5/30/2011 |
| Q: Please look at the output of the program once. #include<stdio.h> #include<conio.h> void main() { ... A: You are correct that a backslash followed by one to three octal digits will place the value of the ... | |
| C pointers | 5/29/2011 |
| Q: can you explain this pointer always stores the starting address of a variable why it occupies ... A: A pointer always has one size, and the size of the pointer does not depend on what it is pointing ... | |
| Find time complexity of a given C program | 5/10/2011 |
| Q: Could you please tell me how to find the time complexity of a given c program?? Please suggest me ... A: The time complexity is a measure of how the execution time varies with the amount of data to be ... | |
| C++ warning | 5/7/2011 |
| Q: kindly tell me the errors in my written code. #include<iostream.h> #include<conio.h> voidmain() { ... A: The error is that you have no space between void and main. You have written a function called ... | |
| Find Cutoff value | 4/28/2011 |
| Q: This is saran, I come up with same program with another doubt. My code: #include<stdio.h> ... A: I think you are not using your substring function correctly in all cases. Notice that the first two ... | |
| C Programming | 4/16/2011 |
| Q: I have a program where i have to use 2-Dimensional array using function. 1) Print normal table with ... A: I'm glad I'm being helpful to you. There are many ways to solve any problem and I don't know which ... | |
| C Programming | 4/16/2011 |
| Q: I have a program where i have to use 2-Dimensional array using function. 1) Print normal table with ... A: The sums calculated in printadd are not actually part of the table so they won't be seen by the ... | |
| C Programming | 4/16/2011 |
| Q: I have a program where i have to use 2-Dimensional array using function. 1) Print normal table with ... A: The problem you are having with printing the maximum occurs because the variable max in the ... | |
| contact mgmt system | 4/1/2011 |
| Q: sir i am preparing a project "contact managemant system". for this i am using structure to enter ... A: The code below shows you how to do it with file pointers. I put comments into the code to explain ... | |
| contact mgmt system | 3/30/2011 |
| Q: sir i am preparing a project "contact managemant system". for this i am using structure to enter ... A: Please understand that in my earlier answer, with the temporary file, you do not need to move the ... | |
| contact mgmt system | 3/29/2011 |
| Q: sir i am preparing a project "contact managemant system". for this i am using structure to enter ... A: The difficulty with deleting a record from a file is that the file does not reorganize itself to get ... | |
| Cosine Function | 3/26/2011 |
| Q: Sir,pls help me to get a program to generate the cosine function.I am totally confused,just a ... A: You are asking me how to generate a cosine function which is an unusual question for a beginner. Are ... | |
| regarding c.... | 3/24/2011 |
| Q: can i know the discription of this coding while ((UCSR0A & (1<<UDRE0)) == 0); UDR0 = data; what ... A: The loop below while ((UCSR0A & (1<<UDRE0)) == 0); is trying to find a bit in UCSR0A which is set ... | |
| update to previous question | 3/18/2011 |
| Q: I am not sure what is wrong with my program. My assignment is to write a program that will return ... A: Don't worry, you are not bothering me with your questions. On my system, your day program compiles ... | |
| Please help me with the following error messages. | 3/18/2011 |
| Q: I am not sure what is wrong with my program. My assignment is to write a program that will return ... A: It is a good effort. There are just a couple of problems. I've corrected the syntax and left you ... | |
| how to use MFC application wizard | 3/15/2011 |
| Q: i would like to ask how recognize the static box in this project. i saw the project in this website ... A: The 5 static boxes are pictured in the attachment. Only two of the boxes (box 3 and box 5) are ... | |
| Command Line Arguments | 3/12/2011 |
| Q: What is the use of command line arguments in GUI OS? or How can we make use of command line ... A: Command line arguments can be useful in a GUI program. How to use them depends on your problem and ... | |
| c-prog | 3/11/2011 |
| Q: void main(){ FILE *fp,*fw; char buffer[100]; double filelatt,filelong,filechl; // ... A: You can have your program go through the directory and get the name of each file in the directory. ... | |
| C | 3/7/2011 |
| Q: I know C++, fairly enough, and now I want to move to C. Is there any book which is equivalent to the ... A: If you know C++ then you already know C. C is a subset of C++. A book that I enjoyed reading is ... | |
| queue | 3/2/2011 |
| Q: i'm new in c++. can you please explain me briefly what is FIFO, LIFO and Priority Queue. what are ... A: You could implement a priority queue as a collection of LIFO or a collection of FIFO queues where ... | |
| queue | 3/1/2011 |
| Q: i'm new in c++. can you please explain me briefly what is FIFO, LIFO and Priority Queue. what are ... A: I will do a LIFO queue for you because it is the easiest. I will show you how to do it with a linked ... | |
| queue | 2/28/2011 |
| Q: i'm new in c++. can you please explain me briefly what is FIFO, LIFO and Priority Queue. what are ... A: As you probably know, a queue is a collection of data that you can add to and remove from, but the ... | |
| Malloc in C | 2/26/2011 |
| Q: I wrote the following testing code: int main() { char *a; a = malloc(20); printf("%d ", ... A: Any integer number, like 1, is by default, four bytes long. So sizeof(1) prints 4 because 1 is an ... | |
| C++ an appetite | 2/25/2011 |
| Q: Just 2 questions: -- Can everything that can possibly be done in C(like the low level stuff and the ... A: Everything you can do in C can be done in C++ because C++ is the entire C language plus extra ... | |
| C++ Traffic Light | 2/22/2011 |
| Q: I'm new for cplusplus. I've to do a source code which can function as traffic light. I'm still ... A: Your program can be made quite simple by creating a traffic light class, and array of 4 traffic ... | |
| file inclusion in C | 2/13/2011 |
| Q: I wrote 2 files in the same project. main.c and array.c. I want to to access the functions in ... A: Your friend is right! The correct way is to create a header file having the declarations of all the ... | |
| scanf in C | 1/30/2011 |
| Q: I wrote the following program to ask the user to write a sentence and then I want to store each char ... A: Use %s instead of %c. The %s will cause scanf to read all characters up to the newline. Here is a ... | |
| unsigned int and int | 1/30/2011 |
| Q: I would like to ask if it is ok to do the following: unsigned int a; unsigned short int b; int c; ... A: The first printf, printf("%u", c), may be giving you a weird display because the "%u" is causing the ... | |
| fwrite and fread functions in C | 1/28/2011 |
| Q: I wrote the following code but when I print it on the screen, it does not shows the int 123. I am ... A: The fread is failing because the file is opened only for writing. You need to open it for reading ... | |
| structures programming | 1/26/2011 |
| Q: . first of all, i would like to thank you for helping me score full mark in my previous c ... A: I'm glad I could help you last time. This time, it is not clear to me what you are having trouble ... | |
| Isolating digits | 12/7/2010 |
| Q: I'm looking for a way to isolate the left digit of a number i.e. 1234 = 1 OR to successively store ... A: Here is another way using a lookup array, and some floating point routines to get the leftmost ... | |
| Arrarys | 12/4/2010 |
| Q: I have coded a program in the C language that checks for repeated numbers. However, I need to write ... A: It is not clear to me what you are trying to do because your pseudo code and your problem ... | |
| Arrarys | 12/3/2010 |
| Q: I have coded a program in the C language that checks for repeated numbers. However, I need to write ... A: Your program doesn't really check for repeated numbers. Maybe it could be used to generate an array ... | |
| Pseudo Code (using arrays) | 12/1/2010 |
| Q: Greetings Zlatko, I appreciate that you are taking time out to look over my question. So, thank you. ... A: Sasha, the changes you are proposing are correct. Just change For index=0 through 9 to For index=0 ... | |
| Pseudo Code (using arrays) | 12/1/2010 |
| Q: Greetings Zlatko, I appreciate that you are taking time out to look over my question. So, thank you. ... A: Yes, you are overloading your array. The array is supposed to hold 7 elements so the index goes from ... | |
| Pseudo Code (using arrays) | 11/29/2010 |
| Q: Greetings Zlatko, I appreciate that you are taking time out to look over my question. So, thank you. ... A: Pseudo code is high level instruction written in an natural language, like English. Pseudo code ... | |
| file read in | 11/29/2010 |
| Q: I'm trying to read in the information from an input file. It's sort of something like this: 1 10 3 ... A: The problem is that fscanf is getting stuck at the colon ':' between reading hours and minutes. The ... | |
| Pseudo Code for Input Validation Program | 11/23/2010 |
| Q: I do greatly appreciate it in advance. I have been instructed to pseudo code a program for a ... A: The style of your pseudo code is closer to that of a programming language than it is to a natural ... | |
| Pseudo Code for Input Validation Program | 11/22/2010 |
| Q: I do greatly appreciate it in advance. I have been instructed to pseudo code a program for a ... A: Pseudo code is really just instructions for solving a problem. The instructions are written in a ... | |
| Sorting | 11/17/2010 |
| Q: So I'm trying to sort people by thier order number in my program. I have to use the merge sort. I ... A: I believe your sort is correct. I have tested it with an array of random integers of various sizes, ... | |
| String compare | 11/17/2010 |
| Q: I need to figure out how to sort birth months in c programming. Right now I'm trying to figure out ... A: The "else return 0" is happening as soon as the first string compare fails. You want it to happen if ... | |
| String compare | 11/16/2010 |
| Q: I need to figure out how to sort birth months in c programming. Right now I'm trying to figure out ... A: From the code you have shown me, I would say that withing the loop for(i=0; i<people; i++) i will ... | |
| Pseudo Code for Math Quiz Program | 11/15/2010 |
| Q: and thank you for taking time to review my question. I have been instructed to design a simple math ... A: I am not quite sure what you are asking. I think you still want pseudo code, and not C code, and you ... | |
| Pseudo Code for Math Quiz Program | 11/15/2010 |
| Q: and thank you for taking time to review my question. I have been instructed to design a simple math ... A: Pseudo code is the middle step between a problem description, like what you gave me, and real code, ... | |
| new question | 11/14/2010 |
| Q: Write a program in C that does the following. 1. Creates a 2-D array of integers of size 4 x 4, say ... A: How did you manage with the sorted 2D array problem? Was my answer to you helpful or did you find ... | |
| C programming Continuation | 11/10/2010 |
| Q: The use of structures could be useful. However, i don't seem to understand how exactly to use ... A: You can create a console interface with simple printf statements to prompt the user for input, and ... | |
| C programming | 11/9/2010 |
| Q: im learing C programming. Im working on a school project that requires me to create a simple data ... A: Yes you can use C to achieve this project. You need to think about what will be stored in the ... | |
| algorithm | 11/8/2010 |
| Q: what are the uses of algorithm...? (please give me answer as soon as possible) A: An algorithm is any set of instructions to do a task. For example, if you write down the steps to ... | |
| Storage location of a variable ? | 11/3/2010 |
| Q: #include <stdio.h> const int x=10; int main() { /* Definition inside the function */ const int y = ... A: I think the const int x is placed in a read only (text) part of the program. It probably depends on ... | |
| sorting of 2-d array | 11/1/2010 |
| Q: Write a program in C that does the following. 1. Creates a 2-D array of integers of size 4 x 4, say ... A: Edit November 2 Hello Pradeep Sorry, I forgot that you are using C, and not C++. In that case, you ... | |
| about algorithms in 'c' language | 10/31/2010 |
| Q: various criteria used for judging an algorithm A: Algorithms are judged on speed and correctness. Of course an incorrect algorithm is worthless. The ... | |
| hi | 10/30/2010 |
| Q: what is a syntax of scanf and printf A: You should read the answer here http://www.cplusplus.com/reference/clibrary/cstdio/printf/ and here ... | |
| Extern storage class | 10/25/2010 |
| Q: #include<stdio.h> extern int count; int main() { printf(" value = %d", count); return 0; } I have ... A: The behavior as you describe it is not correct. I can think of three possibilities to explain it. ... | |
| Call histogram | 10/12/2010 |
| Q: heyyyy... let me tell u abt the whole problem....its a huge CDR file(of which i've only sent 2/3 ... A: The while(1) would normally be an infinite loop, but there is the line if(feof(inFile)) break; /* ... | |
| Call histogram | 10/11/2010 |
| Q: heyyyy... let me tell u abt the whole problem....its a huge CDR file(of which i've only sent 2/3 ... A: Ok, I have a simple program for you to try. I have put many comments into it. You should ask ... | |
| reading specific lines from a text file(CDR File) using C | 10/10/2010 |
| Q: I have a CDR file containing call informations of a single day.I have to read the lines with the ... A: October 11 Tana, it may be a good idea to extract the data you want from CDR with a C program and ... | |
| C programming | 10/7/2010 |
| Q: What do you mean by Abstract Data Type? A: An abstract data type (ADT) is one which is manipulated by functions and where the user of the data ... | |
| C programming | 10/7/2010 |
| Q: Write a C program to add all numbers between 100 and 200 that contain the digit 5? A: If you are having trouble with this assignment, I suggest you break it down into a series of simpler ... | |
| reading specific lines from a text file(CDR File) using C | 10/1/2010 |
| Q: I have a CDR file containing call informations of a single day.I have to read the lines with the ... A: So you want to figure it out for yourself ? Well, you should be proud of yourself. Please tell me, ... | |
| reading specific lines from a text file(CDR File) using C | 9/30/2010 |
| Q: I have a CDR file containing call informations of a single day.I have to read the lines with the ... A: I am sending you a program which will open the file, and isolate the timestamps. Maybe it will be ... | |
| turbo c | 9/29/2010 |
| Q: i got an error "TYPE MISMATCH IN REDECLARATION OF DRAW" here draw is a function. why i got that ... A: It is difficult to say what the problem is without seeing the code. I suspect that draw is is a ... | |
| for prototype error | 9/28/2010 |
| Q: i write a program in c language and if run it i get prototype error. how i solve the error A: Are you sure you are getting the error when running, and not when compiling ? If you are getting ... | |
| C | 9/28/2010 |
| Q: Write a program which allows the user to enter characters until the input is 0.Each time a ... A: For ethical reasons, I am not going to write the program for you. I will help you if you show me ... | |
| code ? | 9/27/2010 |
| Q: someone on face book put this on there or it's just a code i think hex or something similar, do u ... A: They are just hex numbers. It is impossible to say what they mean on their own, without knowing how ... | |
| C output confused | 9/24/2010 |
| Q: Help - void main () { int a=-5; -a; cout<<a; ... } Output is -5 Why isnt dis output 5 .. A: The line: -a; does evaluate the negative of "a", but the result is not stored. To change the value ... | |
| read fuction in c | 9/20/2010 |
| Q: i m paritosh, and i want to know that what is the meaning of the read function with argument file ... A: When a program starts, there are three file descriptors open. The stdin file descriptor reads from ... | |
| exe file of c++ program | 8/27/2010 |
| Q: how can we create an exe file of a c++ program which can run without c++ compiler also? A: Your C++ compiler will create an exe file. Once you have the exe file, you can run it on any ... | |
| how to open a file? | 7/20/2010 |
| Q: When you have printed to the text file, (as when we make an error log file like we discussed last ... A: Sure that works too. I usually don't use the system call, because it opens a command interpreter to ... | |
| how to open a file? | 7/20/2010 |
| Q: When you have printed to the text file, (as when we make an error log file like we discussed last ... A: If you want the file opened in notepad for viewing there are 2 ways. The simpler is to use the ... | |
| addition program tester | 7/19/2010 |
| Q: Although this was a simple program to test the addition (see below), what would make an effective ... A: What I meant was to print the errors to a log file, not to the screen. It is quite common to store ... | |
| c++ | 7/17/2010 |
| Q: Create a flowchart that will determine the factor of a number entered by the user. Display the ... A: create your code with if-else. Then show me the code. If it can be converted to switch-case, I'll ... | |
| addition program tester | 7/17/2010 |
| Q: Although this was a simple program to test the addition (see below), what would make an effective ... A: The stack is an area in the program's memory that is used to store all the variable you define in ... | |
| addition program tester | 7/16/2010 |
| Q: Although this was a simple program to test the addition (see below), what would make an effective ... A: What is a good summary is a matter of opinion, but I would not want to read through 10,000 lines of ... | |
| add function and argv | 7/13/2010 |
| Q: Here is my attempt below. I did the argv addition program last time but I now want to be able to ... A: Yes you could use it as an autotester. You could put it into a separate autotest function, so that ... | |
| add function and argv | 7/13/2010 |
| Q: Here is my attempt below. I did the argv addition program last time but I now want to be able to ... A: Mike, I knew the pipe code would be too complicated. I did it partly for my own education. I had ... | |
| add function and argv | 7/11/2010 |
| Q: Here is my attempt below. I did the argv addition program last time but I now want to be able to ... A: It is certainly possible to write a program to call your addition program with any operands and read ... | |
| doubt in C | 7/10/2010 |
| Q: basic concept of reading %26 writing characters in file using C language...... then tell the concept ... A: A file has a file pointer and, when bytes are read from a file, they are read from the position of ... | |
| argv | 7/6/2010 |
| Q: sorry it didn't go thru last time, here's the code of what I attempted to do, hopefully we can get ... A: You have a small misunderstanding about how to use functions. You don't need to make a separate ... | |
| addition and putchar | 7/4/2010 |
| Q: I got the addition prgram to work the way I wanted (see below) with just using putchar function and ... A: This is a bug that happens often. You have copied code from one part of the program into another and ... | |
| converting from integer to ascii?? | 7/1/2010 |
| Q: but I enter in let's say, 123 as integer. And then when I run program, it tells me that I've entered ... A: I am so very sorry. I sent you bad code for the reverseString function. I know I tried to test the ... | |
| converting from integer to ascii?? | 6/30/2010 |
| Q: is there a simple way to convert an integer to ascii?? I'm supposed to try implement my own version ... A: That's great. You just about have it done. I've put it into functions for you so that you can see ... | |
| converting from integer to ascii?? | 6/30/2010 |
| Q: is there a simple way to convert an integer to ascii?? I'm supposed to try implement my own version ... A: That is a good attempt. I would say that you don't need a "for" loop. You need a while(number != ... | |
| converting from integer to ascii?? | 6/29/2010 |
| Q: is there a simple way to convert an integer to ascii?? I'm supposed to try implement my own version ... A: Implementing itoa is not difficult. I will describe to you the basic idea. You try to implement it. ... | |
| Oh, Dynamic Programming !!!! | 6/29/2010 |
| Q: I have a problem in solving this problem : You have a bunch of N (1<=N<=10000) numbers and you want ... A: Edit 7 July 2010 Hello Abody As promised: ... | |
| scanf and adding binary numbers | 6/23/2010 |
| Q: Once again, thank you very much for spending time with me on this program. Here is the revised code, ... A: Good effort. Yes, functions are always the way to go. Even for a small assignment, your instructors ... | |
| scanf and adding binary numbers | 6/22/2010 |
| Q: Once again, thank you very much for spending time with me on this program. Here is the revised code, ... A: Well Mike, Its never too late to start doing the right thing. If you agree that functions are better ... | |
| c language | 6/22/2010 |
| Q: what are the different types of errors are a raised in C language. Please tell me detailed ... A: To see the different types of errors in the C language, start writing C programs. When you compile ... | |
| scanf and adding binary numbers | 6/22/2010 |
| Q: Once again, thank you very much for spending time with me on this program. Here is the revised code, ... A: What happens if you input 123 for the first number and 456 for the second ? You get a sum of 123579. ... | |
| scanf and adding binary numbers | 6/21/2010 |
| Q: I'm wondering how you'd do this. I realize that scanf function converts ascii directly to binary for ... A: You have a loop for(i=0; i <2; i++) to input the two numbers. You know that you need to store one ... | |
| scanf and adding binary numbers | 6/21/2010 |
| Q: I'm wondering how you'd do this. I realize that scanf function converts ascii directly to binary for ... A: The "for" loop is going through the input characters. It is going over them from left to right. ... | |
| scanf and adding binary numbers | 6/21/2010 |
| Q: I'm wondering how you'd do this. I realize that scanf function converts ascii directly to binary for ... A: The atoi function will take a numeric string and return the integer value for that string. It ... | |
| scanf and adding binary numbers | 6/21/2010 |
| Q: I'm wondering how you'd do this. I realize that scanf function converts ascii directly to binary for ... A: I think I do understand your question. Let me clarify one thing. You do not need to translate a ... | |
| c | 6/19/2010 |
| Q: Sir, I am beginner of c language. what is meant by object-oriented language. A: Object orientation is a way to organize your program. In object orientation, a program is subdivided ... | |
| about c | 6/14/2010 |
| Q: sir, i want to know that how to create an .EXE file of a compiled and executable C program in order ... A: Once you have compiled your C file, you will have an executable file. To compile, means to create ... | |
| C programming | 6/12/2010 |
| Q: Please help me in writing a C Code for Deletion of Duplicates from a Sorted array. thanks A: The easiest way to do this is to first print the unique elements to the screen. Once that is working ... | |
| question about c | 6/11/2010 |
| Q: I'm the beginner of C programming. i'm confused at the very beginning.... i couldn't understand that ... A: You are my first Nepalese questioner! In C, all code must be in functions. The main function is the ... | |
| CC++ Java | 6/10/2010 |
| Q: Write a program to implement a method display(int n) 1.For example if n = 4, the output should be ... A: You will need 2 loops, one within the other. The outer loop has to count from n down to 1. It will ... | |
| C | 5/30/2010 |
| Q: i have a question regarding c . like see main() { int *p="amit"; p[0]='h'; printf("%s",p); this prgm ... A: Yes, I agree with you. I think it is because Linux places the string in the code segment so it ... | |
| C | 5/28/2010 |
| Q: i have a question regarding c . like see main() { int *p="amit"; p[0]='h'; printf("%s",p); this prgm ... A: I believe you are correct that the linux machine puts the string "amit" into read only memory. I ... | |
| c | 5/26/2010 |
| Q: Hey am kinda new @ this so..i kinda need some help understanding this part.. if (decimal < 0) { ... A: The first part is keeping the decimal positive. So that if it is less than 0, it is multiplied by -1 ... | |
| [C] Delete an element from a list | 5/22/2010 |
| Q: Given a (dynamic allocated) list in C: /* The solution must use this type of list,even if a list ... A: I did try it. The program I sent you makes a list of 0 2 1 0 2 1 0 2 1 0 It then deletes all the ... | |
| [C] Delete an element from a list | 5/21/2010 |
| Q: Given a (dynamic allocated) list in C: /* The solution must use this type of list,even if a list ... A: You do not need to know if you are on the real first element of the list. For the purpose of the ... | |
| some stiches.. | 5/20/2010 |
| Q: now, when i tested the full code with this file ... A: It is important that you get the percentage total to add to 100, (or 99.9999 with round off error). ... | |
| return type in c | 5/19/2010 |
| Q: i am confused with return types in c programing,use of arguments i.e. parameter of function is ... A: A function performs a task. If the task is to calculate a value, the function must return the value. ... | |
| Confuse In Pointer...@ | 5/15/2010 |
| Q: .. My Name Is Vandan & I Am In T.Y B.C.A. I Need Help In Pointer In C Prog. QUESTION :- HOW ... A: Here is some sample code with comments to show you how pointers can be used. /* declare 2 integers ... | |
| C programming (ansi c standard) | 5/12/2010 |
| Q: ANSI C library functions to export these five set functions. 1) Take a set as inputs from the key ... A: May 13, 2010 ---------------- Hello Raphael. As I promised, I have looked more at the questions you ... | |
| C programming (ansi c standard) | 5/12/2010 |
| Q: ANSI C library functions to export these five set functions. 1) Take a set as inputs from the key ... A: For ethical reasons, I don't do people's homework. I help. In order to help, You have to tell me ... | |
| Need help with a basic C program | 5/9/2010 |
| Q: I just started to learn the C language today and I am trying to get this simple program to work. I ... A: I think you did pretty well on your program. I have 2 versions for you. The first is your program ... | |
| Reading variable names from a file. | 4/27/2010 |
| Q: I would like to ask if it possible to have a text file that contains MACRO names, and while reading ... A: I am quite sure that this cannot be done. A macro is not "called" at runtime. A macro is expanded by ... | |
| i need a help in c++ | 4/25/2010 |
| Q: 1)Write a program to express a given number in terms of hours ,minutes, and seconds and output the ... A: You use the ifstream for input, and ofstream for output. Here is the program. #include <iostream.h> ... | |
| i need a help in c++ | 4/25/2010 |
| Q: 1)Write a program to express a given number in terms of hours ,minutes, and seconds and output the ... A: I see now that I did not understand your original question. The problem is with calculating ... | |
| i need a help in c++ | 4/25/2010 |
| Q: 1)Write a program to express a given number in terms of hours ,minutes, and seconds and output the ... A: I am not sure if you need help with the programming or the algorithm. The first step is to develop ... | |
| programming language | 4/20/2010 |
| Q: Write a program in C program to find the sum of the following: The input contain a sequence of two ... A: Well that is a start, but you have to start your sum at 0, not at 1. There is no reason to ask the ... | |
| programming language | 4/19/2010 |
| Q: Write a program in C program to find the sum of the following: The input contain a sequence of two ... A: I think the question is asking you to read in a series of numbers from the keyboard until the -1 is ... | |
| How can i evaluate expression in if condition | 4/15/2010 |
| Q: I want to evaluate string expression in if stmt. E.g. int i = 0,j = 2; char * str = "(i == 0) || (j ... A: It still seems to me that you need to write an interpreter to evaluate the "C" code at runtime. ... | |
| How can i evaluate expression in if condition | 4/14/2010 |
| Q: I want to evaluate string expression in if stmt. E.g. int i = 0,j = 2; char * str = "(i == 0) || (j ... A: It cannot be done easily. It is not part of the language. You need to parse the string and interpret ... | |
| searching a file through c program | 4/11/2010 |
| Q: i need a logic for a program which can read file name from user and then search for that file name ... A: On Windows you need the FindFirstFile and FindNextFile functions. You can see a sample of code here: ... | |
| api | 4/10/2010 |
| Q: I want 2 make use of GUI in my project work. But I don't know how 2 add on graphical stuff using C ... A: Header files are added to your files with the include statement like this #include <stdlib.h> The ... | |
| api design | 4/10/2010 |
| Q: I dont know how to design user interfaces using C. I need ur help regarding theory and examples so ... A: Please tell me which operating system you are using and which compiler. I believe I answered your ... | |
| api | 4/9/2010 |
| Q: I want 2 make use of GUI in my project work. But I don't know how 2 add on graphical stuff using C ... A: I believe that in your part of the world, Turbo C/C++ is very popular, and I think it has ability to ... | |
| C Language question | 4/8/2010 |
| Q: "The sign on the attendant’s booth at the XYZ parking lot is XYZ VISITOR PARKING Cars: First 2 ... A: At first, simplify the problem. Don't worry about the summary. You can do that later when you are ... | |
| Please explain the concept of dynamic memory allocation with an example | 4/7/2010 |
| Q: Why the following program prints the string more than 6 characters although declared as 6 ... A: The gets() has no way of knowing how much space is allocated for s. It will overwrite past the end ... | |
| Loop Question | 3/30/2010 |
| Q: Im not sure how to actually start the code... The code I have been doing keeps giving the incorrect ... A: That's pretty good, but you are missing the increment of the loop counter "num". Also, you probably ... | |
| C file handling | 3/17/2010 |
| Q: i have written program for writing in file using c language,but i don't know that how i enter/write ... A: I think I understand your question. You want to see the contents of your file using a command from ... | |
| gui programmin | 3/12/2010 |
| Q: help me how to startup with c for Graphical User Interface. For example,how can i make hello window ... A: That's a good question. C does not have any Graphical User Interface (GUI) functionality itself. ... | |
| working of +,/, - in c | 3/10/2010 |
| Q: I have a siple question I have a=3+4/3*7 when I run a program I got answer 10 Please calrify ... A: You are doing integer arithmetic in your program. With integer arithmetic, the fractional part is ... | |
| data Structures | 3/3/2010 |
| Q: Why "&" is not required while reading a character array with "%s" specifier? A: The & is not required because with %s you are reading the characters into an array. An array ... | |
| swaping | 2/26/2010 |
| Q: how to make multi threading in c++ A: C++ does not have any multi-threading features built into the language. To do multi-threading you ... | |
| swaping | 2/26/2010 |
| Q: how to swap 3 no without using 4th no and efficiently A: I believe you want to swap 2 numbers without using a third temporary number. The code uses ... | |
| how to repeat the program ? | 2/19/2010 |
| Q: below attached is my code for my program . would like to ask wat should i do if i want the program ... A: What you need to do is put the entire code into a loop and at the end of the loop, ask the user if ... | |
| operator overloading | 2/7/2010 |
| Q: please check my program of c++. i am trying to overload += operator for 2strings #include ... A: Your operator+= method needs to take the characters in the parameter 't', and add them to the 's' ... | |
| array | 1/31/2010 |
| Q: how to create a program using array....for example.. make a program that would input five integers ... A: ydur, here is a simple example to get you started. It is up to you to write the sorting function. I ... | |
| main() function in C | 1/20/2010 |
| Q: I’m a beginner in C and since now I’ve made just a few simple exercises. I have a question, if you ... A: There are 2 correct versions of the main function that are used most often and that you should know. ... | |
| How many bytes | 1/11/2010 |
| Q: I'm trying to check how many bytes are occupied by function scanf("%d",&i) (where i is int). I ... A: It is not possible to find how many bytes a function occupies in this way. What sizeof is returning ... | |
| pls let me know the answer as soon as possible.. | 11/25/2009 |
| Q: how to implement 2 queues in a single array? A: First simplify your problem to 1 queue in an array. For your array, you have a beginning at 0 and an ... | |
| Reverse satck . | 11/23/2009 |
| Q: the previous answer help me a lot... now i facing some problem... the code i edited is as bellow, ... A: Canno, I don't have much time right now to look at your problem. I will look at it later today. But ... | |
| Reverse satck . | 11/22/2009 |
| Q: Write a program that reverses the string contents of a stack (the top and bottom elements exchange ... A: Here are the changes you need to make: 1) change stackNode to have: char* data; as the data type. ... | |
| Reverse satck . | 11/22/2009 |
| Q: Write a program that reverses the string contents of a stack (the top and bottom elements exchange ... A: There are 2 ways that I can read your problem. 1) You want to read one string into the stack so ... | |
| arrays | 11/16/2009 |
| Q: first i wanted to thank you for the last response..it helped out a lot. now i have an assignment ... A: Edit: Sorry, there was an error in the code I sent you. The corrected is below. Hello Christopher. ... | |
| arrays | 11/15/2009 |
| Q: first i wanted to thank you for the last response..it helped out a lot. now i have an assignment ... A: Well OK You can have a loop in the main to enter the answers like this: cout<<"Please enter the ... | |
| arrays | 11/15/2009 |
| Q: first i wanted to thank you for the last response..it helped out a lot. now i have an assignment ... A: If I understand correctly, you have 2 arrays. One array has the student's answers, and the other ... | |
| header files | 11/13/2009 |
| Q: if i save my program with .c extension, my program run successfully with printf(), scanf(), getch(), ... A: If the correct header files are not included, the C compiler will make assumptions about the ... | |
| C programming | 11/12/2009 |
| Q: Actually i am trying to solve this question. "B. Write a program to enter two dates as shown, and ... A: Please post a follow-up question and show me what you have done so far. I will be happy to help you ... | |
| Merging char-arrays | 11/11/2009 |
| Q: I need answer to the following program in C/C++. You are required to write a program that takes ... A: The easiest way to do this is to input the two arrays, create one large array with the data of both ... | |
| Merge Sort | 11/11/2009 |
| Q: n log 2n Solve via merge sort & get the complexity.. A: I will think about your problem. Have you tried to write a merge sort yourself? It would be good for ... | |
| C++ File manipulation | 11/5/2009 |
| Q: I am using windows XP and DEV C++ I want to make a program used in file transfer. How do you copy ... A: The functions you are looking for are CopyFile and MoveFile. The MoveFile does the renaming. The ... | |
| RSA Encryption in C | 11/5/2009 |
| Q: I have recently written a program in c for the demonstration of the RSA encryption. for some reason ... A: You can send me the code as an attachment to zlatko.c.help at gmail.com or you can post it as a ... | |
| Stuck on a problem using c | 10/17/2009 |
| Q: I'm doing some work at the moment, in which i've hit a brick wall. I'll post what i've done to begin ... A: You have to keep track of each box's capacity and decrease the capacity as you put items into the ... | |
| Stuck on a problem using c | 10/16/2009 |
| Q: I'm doing some work at the moment, in which i've hit a brick wall. I'll post what i've done to begin ... A: Derrick, I can understand the use of int box[numberOfItems][numberOfBoxes]. You have an array of ... | |
| Stuck on a problem using c | 10/16/2009 |
| Q: I'm doing some work at the moment, in which i've hit a brick wall. I'll post what i've done to begin ... A: I commend you for doing as much of your assignment as possible. My aim is to help you get your ... | |
| simple club membership program | 10/9/2009 |
| Q: how to create simple club membership program in c?? A: Philip, the first thing you should do is make a clear list of what you want your program to do. I ... | |
| 'malloc' function | 10/8/2009 |
| Q: My C code compiled on a MAC station gives me a segmentation fault when it tries to go through the ... A: Alex, there is nothing in the code you posted that would normally cause a seg fault. You should, ... | |
| PROJECT | 10/2/2009 |
| Q: Write an ANSI C program to implement a doubly-linked self organising list.A self-organising list is ... A: According to the problem, the node count is incremented whenever a node is found using the search ... | |
| PROJECT | 9/29/2009 |
| Q: Write an ANSI C program to implement a doubly-linked self organising list.A self-organising list is ... A: Yes, I can help you but you have not told me what you are having trouble with. I understand your ... | |
| charector and string manipulation using pointers | 9/20/2009 |
| Q: i have to work on two functions one to replace and another one to match strings using pointers. ... A: I'm glad to help, but I have to remind you that thinking about the strmatch algorithm is a good ... | |
| c programming | 9/13/2009 |
| Q: i have a problem main() { printf("%u",main); } when i m compiling it,its giving an error- Cannot ... A: You are correct. The program should print out the address of the main function. I have tried it with ... | |
| Turbo C using fseek | 8/28/2009 |
| Q: sir/madam i need your help regarding this issue...How to use fseek function to search some file in a ... A: You are correct that you should not be using fseek. The code to find a record based on the employee ... | |
| Turbo C using fseek | 8/26/2009 |
| Q: sir/madam i need your help regarding this issue...How to use fseek function to search some file in a ... A: I've had a look at your code and I believe the fundamental problem is that you're trying to seek to ... | |
| c graphics | 8/14/2009 |
| Q: sir i want a program in c which, take our photo from our storage drive like 'd' drive. and display ... A: Sir: Thank you for your question. Although I don't have experience solving this particular problem, ... | |
Answers by Expert:
Top Expert on this page
I can answer questions about C / C++ programming, software design, algorithms, and interprocess communication. I have access to Microsoft Visual Studio and gcc as my development platforms.
I have been developing software professionally for UNIX and Microsoft Windows since 1991.
Education/Credentials
I have a Bachelor of Applied Science in Computer Engineering from the University of Waterloo located in Waterloo, Ontario, Canada.

©2012 About.com, a part of The New York Times Company. All rights reserved.