C++/Questions Answered by Expert vijayan

SubjectDate Asked
Is heap an implicit data structure to implement priority queue?1/20/2012
  Q: My question might seem childish but I really don't understand this question as I am just a newbie to ...
  A: I too don't really understand what the term 'an implicit data structure' means. Perhaps, the ...
saving a structure to a file.1/9/2012
  Q: halo mr. vijayan. my question is relatively simple (i am new to programming). how do you write a ...
  A: Input-output of a bit field directly is not a good idea; there are implementation-dependencies ...
Error in program1/3/2012
  Q: I use Turbo C++ v4.5 on Windows Vista. The below-mentioned program always gives an error "Error ...
  A: 1. Switch to a more current compiler suite and IDE - for example, CodeBlocks+MinGw ...
64-bit12/29/2011
  Q: How are you? I have written a script for a 32-bit machine (Ubuntu). I'm now compiling it for a ...
  A: > What is the right way to do it so that it would work on both 32 and 64-bit? When printing out a ...
Help me to fix the bug in my c++ code12/25/2011
  Q: The following function in Turbo C++ (Win XP environment) has been written to return the maximum of ...
  A: Without seeing the whole program, I don't know why you get an error after adding precisely 13 ...
Programming Language Source Files Business Rules.12/15/2011
  Q: http://en.wikipedia.org/wiki/Source_code There are some queries from my side regarding Programming ...
  A: > Can Programming Language Source code file naming extensions be duplicated ? > Does it become ...
Test score12/9/2011
  Q: #include <iostream> #include <iomanip> using namespace std; { const int maxNumScores = 10; int ...
  A: Write a function to sum up all the scores: double sum( const double score[], int numScores ) { ...
C++ Compiler12/6/2011
  Q: Is it possible that install a compiler of c++ in mobile and run small programs with it? thanks in ...
  A: Yes. Though the specifics depend on the mobile platform. For example: ...
scope12/5/2011
  Q: How are you? Thanks for taking questions. In my *.h file I have this class class LargeFile { int x; ...
  A: > void mergeFiles() > { > x=5; > } > The compiler says that x was not defined in this scope. But ...
C++12/2/2011
  Q: Sir, i m a beginner in c++? Please recommend a c++ tutorial programe Online? Sir Can we make ...
  A: > What can i do with visual c++? Visual C++ is an IDE and C++ compiler; it is a tool to assisting ...
C++12/1/2011
  Q: Sir, i m a beginner in c++? Please recommend a c++ tutorial programe Online? Sir Can we make ...
  A: There are several online C++ tutorial sites; here are a few of them: ...
About Dots and Boxes Program11/28/2011
  Q: I read your previous post on the dots and boxes codes. I have a question relating to the same. How ...
  A: > How do we declare the following function- void print_grid(const grid_t& grid, std::ostream& stm) ...
Computer Games.11/19/2011
  Q: 1. Is Computer Games classified as a System or Application Software ?. Computer Games involve ...
  A: > If we use Joystick interfacing input device for the particular game designed, it will also require ...
Computer Games.11/17/2011
  Q: 1. Is Computer Games classified as a System or Application Software ?. Computer Games involve ...
  A: > Is Computer Games classified as a System or Application Software ?. > Computer Games involve ...
Convert visual c++ to linux c++11/15/2011
  Q: My name is srikanth and i am doing some breakpad related testing and i want to crash a specific ...
  A: C or C++ is platform agnostic; the language libraries do not provide any facilities for this. Start ...
Dots and boxes game11/11/2011
  Q: I have written most of the program to play against the computer and understand what is supposed to ...
  A: Use a std::vector for the grid: #include <vector> #include <iostream> typedef std::vector<char> ...
Help turning psuedo code into c++ code11/9/2011
  Q: Alright I am trying to write a program that will play Dots and Boxes, the common paper and pencil ...
  A: > char grid[input][input]; This is not valid C++. The number of elements in a C-style array must be ...
Help turning psuedo code into c++ code11/9/2011
  Q: Alright I am trying to write a program that will play Dots and Boxes, the common paper and pencil ...
  A: Ok, let us take this up one (small) step at a time. The grid is a two dimensional NxN structure as ...
help me out11/3/2011
  Q: i understand you but can you help me out i tryed to use vector function to solve the search ...
  A: I can only guess; most probable cause would be that the file "document.txt" does not exist in the ...
search10/31/2011
  Q: i doesnt display that search word can you please help me out #include<iostream> #include<math.h> ...
  A: > display only the text where the search word is std::string::size_type pos = line.find(SearchID) ; ...
search10/31/2011
  Q: i doesnt display that search word can you please help me out #include<iostream> #include<math.h> ...
  A: You need an <b>int main()</b> in every C++ program. You have included a lot of headers, many of ...
ADTs help10/25/2011
  Q: Alright so I made the functions from the calls inside "primaryElection" and my program compiles and ...
  A: #include "candidates.h" #include "candidateCollections.h" #include "states.h" #include <fstream> ...
ADTs help10/24/2011
  Q: Alright so I made the functions from the calls inside "primaryElection" and my program compiles and ...
  A: There is a logical error in the function you indicated. void readCandidates(istream& input) { // ...
c++10/20/2011
  Q: polymorphism is two types. 1)compile time polymorphism 2)run time polymorphism. then what is meant ...
  A: Compile-time is the time when your source code is being compiled. Templates are instantiated at ...
Web Designing and Web Development Combination Exper10/18/2011
  Q: We observe that there are experts in Web Designing Software viz. Adobe Photo shop, Flash, Action ...
  A: No, I do not. Between the two, I think that great programming is the more creative activity. I ...
Debugger Design and Source Programming Language in IDE.10/18/2011
  Q: http://en.wikipedia.org/wiki/Debugger Most of the Integrated Development Environment has a ...
  A: > 1. Similar to Compiler, De Compiler System Software Design, what are the Algorithms for Designing ...
Web Designing and Web Development Combination Exper10/17/2011
  Q: We observe that there are experts in Web Designing Software viz. Adobe Photo shop, Flash, Action ...
  A: The skills required are quite different. As are their world views. Programmers are technical ...
question about c10/16/2011
  Q: sir compiler compile the whole program . compiler is also a set of program than who checks the error ...
  A: The current practice is that the compiler writers (and users over a period of time) run these tests. ...
Linked List9/29/2011
  Q: for some reason the data are not linking in the following code. The purpose of the code is to take ...
  A: p=p->next; p=new node; The pointer p is being lost here. p->next = new node; p = p->next ; ...
Frequency analysis9/27/2011
  Q: .. I've an cryptographic related assignment where I need to code frequency analysis program that ...
  A: Rather than use a struct, it would be simpler to use a two-dimensional array to store the ...
C Language9/22/2011
  Q: ‎#include <stdio.h> main() { int n=1; printf("%d %d %d", ++n, ++n, ++n); } what will be ...
  A: The program is ill-formed and results in undefined behaviour. printf("%d %d %d", ++n, ++n, ++n); ...
c++-data types9/21/2011
  Q: How to make user defined data type with its own range(e.g. 1 to 5) in c++ ?
  A: A simple way is to use an enum: enum values_t { ONE=1, TWO, THREE, FOUR, FIVE }; If you want to ...
overloading operator in c++9/18/2011
  Q: i tried overloading << operator. it gave me compilation error for following code. ostream& operator ...
  A: > Is it mandatory to keep overloading operator functions as friend. No, it is not. Overloading ...
System v/s Application Software9/14/2011
  Q: Software can be broadly classified into 1. System Software 2. Application Software Examples of ...
  A: > As we observe there are more IT Cos in building Application Software than building System Software ...
wmm and mpeg9/7/2011
  Q: How do I know if my mpeg video file is a mpeg 1 or mpeg 2? I asked this same question on Bing and ...
  A: If you cannot play the video in Windows Movie Maker, it is probably MPEG2. "Although you can play a ...
parameterised constructor8/27/2011
  Q: Sir, Yesturday I was reading about parameterised constructors. I read "There are two types of ...
  A: > I just want to know is whether there is any difference between working of these two? There is no ...
Could you plz help me in solving my general query regarding recruitment process ?8/18/2011
  Q: This is sanjeev MCA student (Final year).Could you plz help me in solving my following general query ...
  A: > here 65% aggregate means the 65% marks should be in 10th,12th,Graduation individually > or ...
fatal error in c++8/11/2011
  Q: #include<iostream.h> void m1(int *a){ a = new int[20]; a[0] = 100; } void m2(int *a){ a = ...
  A: Well, Turbo C++ is obsolete - it predates the C++ standard. Three good options for programming in ...
fatal error in c++8/9/2011
  Q: #include<iostream.h> void m1(int *a){ a = new int[20]; a[0] = 100; } void m2(int *a){ a = ...
  A: It appears that you are either using an obsolete, non-standard, C++ compiler or there is a problem ...
fatal error in c++8/9/2011
  Q: #include<iostream.h> void m1(int *a){ a = new int[20]; a[0] = 100; } void m2(int *a){ a = ...
  A: <iostream.h> is not a standard C++ header. Use #include <iostream> instead. You may want to add ...
Operating Systems Booting through USB Tape Device7/19/2011
  Q: Every Operating System has different File Systems Format. As we know Tape Devices, a secondary ...
  A: > So if Programmed (BIOS programming) and Writing a Device Driver under Windows Os maybe in C or C++ ...
Operating Systems Booting through USB Tape Device7/18/2011
  Q: Every Operating System has different File Systems Format. As we know Tape Devices, a secondary ...
  A: > what is the reason that we see CD ROM , DVD ROM, Hard Drives, USB Pen / Thumb Drives being used as ...
Operating Systems Booting through USB Tape Device7/18/2011
  Q: Every Operating System has different File Systems Format. As we know Tape Devices, a secondary ...
  A: > can we also use tapes as a bootable media for Booting Operating Systems ? Yes, provided the bios ...
c++ site6/7/2011
  Q: I want to get a career making video games but don't know exactly where to start. Do you know any ...
  A: Here are some game development resources: gamedev.net http://www.gamedev.net/ Check out their ...
Decompiler and Obfuscator System Software programs5/31/2011
  Q: I want to get some inputs from your end regarding Decompiler and Obfuscator software programs. ...
  A: > Some information on Logic and Algorithms for Designing and Building a Decompiler program - > say ...
I did it by my own4/28/2011
  Q: But the problem is about Epsilon now ...I am not able its giving error ... I have to include it in ...
  A: Slight variations in rounding can change the outcome of exact floating-point comparisons. leading to ...
CORRECTTNESS PLZ4/21/2011
  Q: circle and rectangle is inherit with only point not point3d. kindly check this and make it correct ...
  A: Inheritance in C++ implies an IS-A or CAN-BE-SUBSTITUED-FOR relationship. So I think that point3d ...
Clone and encapsulation in c++4/19/2011
  Q: as i understand clone provides way of virtual constructor or copy constructor. I've read somewhere ...
  A: > As per my understaing encapsulation hide the implementation details. So how are we achieving using ...
serial port communication using c++4/18/2011
  Q: sir, i have been asked to do serial port programming using C++ it should include opening port, ...
  A: Serial port programming is somewhat platform specific. Since you are using VC++, I presume that you ...
can we write C++ in visual studio4/18/2011
  Q: I am having Microsoft visual studio 2010 express(Microsoft visual c++ 2010 express).when i tried to ...
  A: > '67.exe': Loaded 'C:\Documents and Settings\reshmirose\Desktop\67\Debug\67.exe', Symbols loaded. > ...
can we write C++ in visual studio4/18/2011
  Q: I am having Microsoft visual studio 2010 express(Microsoft visual c++ 2010 express).when i tried to ...
  A: > please tell whether i can run C++ programs in visual studio or not.... Yes, you can compile and ...
CharBuffer4/17/2011
  Q: "I want to design & implement a CharBuffer class, particularly handle character stream for storage. ...
  A: > CharBuffer CB1= new CharBuffer(5000); Create a char buffer this way: CharBuffer CB1(5000); In ...
Clone and encapsulation in c++4/15/2011
  Q: as i understand clone provides way of virtual constructor or copy constructor. I've read somewhere ...
  A: Cloning is the making another object which is an exact copy of a given object (instead of just ...
How to create a printdata function in this code?4/10/2011
  Q: I have a programming assignment due soon and cannot figure out this last part of the assignment. ...
  A: Well, this part of main should be something like: for(int i=1;i<=count;i++) { ...
convert roman to decimal with recursion4/9/2011
  Q: i need help to find out a correct algorith to convert o roman numeral string in a decimal numeral ...
  A: a. Create a table of Roman numerals and their values: I = 1, V = 5, X = 10, L = 50, C = 100, D ...
algorithm4/8/2011
  Q: how "Divide and Conquer method" is differ from "Greedy method"? which One is better?
  A: > how "Divide and Conquer method" is differ from "Greedy method"? A divide and conquer algorithm ...
Removing Duplicates in a Vector4/6/2011
  Q: I am writing a program that is suppose to remove duplicates in a vector. I am having trouble ...
  A: > I am suppose to go through all the elements and check to see if the same value occurs at a lower ...
Help with turning this Pseudo code into c++?4/4/2011
  Q: Hey, I have a c++ test in almost a week and am having trouble with this one question on functions on ...
  A: I'll get you started on this homework. #include <iostream> void getdata( int& length, int& width, ...
textread function4/2/2011
  Q: I was really get dumped for more than a month completing this project of mine. Just as I thought I ...
  A: > there's a whole lot of new functions i do not recognize like startod(), startof()... These are C ...
file handling3/28/2011
  Q: I just want to ask some help with regarding file handling in c++. I am using bloodshed dev and been ...
  A: To append data to a text file, open the file for output in append mode. For example, this will ...
Expert Opinion3/28/2011
  Q: In my class, I was asked to write a short essay (and get "expert opions from the internet) about ...
  A: > Do you have an opinion on this? Yes, I do. Like many creative endeavours which produce ...
please help me out3/17/2011
  Q: hey vijay thank u for answering the previous quesktion? i have got one more quesktion? i trying to ...
  A: Suppose the change in cents is 534. 534 / 200 == 2 is the number of 200 cent coins 534 % 200 == ...
c++ help3/17/2011
  Q: For my assignment I am to write a program that reads a series of integers from the keyboard. I am ...
  A: > the teacher said to use climits int_min and int_max see: ...
please help me out3/16/2011
  Q: Please can u help me out i am trying to read (the numbers) from the text file. and it is working ...
  A: For basics of file input, see: http://www.arachnoid.com/cpptutor/student2.html Find the sum of all ...
Initializing static const arr3/14/2011
  Q: Can you tell the possible ways of initializing static const string arr[7] with weekday names. And ...
  A: enum { NDAYS = 7 }; static const std::string arr[ NDAYS ] = { "Monday", ...
difference3/14/2011
  Q: what is the difference between perfect numbers and perfect square numbers?
  A: http://en.wikipedia.org/wiki/Perfect_number In mathematics, a perfect number is a positive integer ...
C++ HW ambiguous overload for 'operator cin >> operator2/18/2011
  Q: I am having trouble declaring my variables. Can you please show me what I am doing wrong. The ...
  A: You cannot use std::cin to compute a value. #include <iostream> using namespace std; int main() { ...
Dotted decimal to binary conversion.2/16/2011
  Q: .. i don't know how to convert dotted i made a simple conversion program . can you please help me ...
  A: Use a std::bitset<> to get the binary representation of a number: #include <bitset> #include ...
C++ Homework using the "if" statement2/16/2011
  Q: I am having trouble declaring my variables. Can you please show me what I am doing wrong. The ...
  A: You can not have variable names in C++ like 'Total Number of Seconds'.In particular, white space is ...
C++ newbie need help with fixing code2/9/2011
  Q: I’m a C++ newbie and I’m taking my 2nd class but, I’m confused as to how to do my homework problem. ...
  A: 1. First define the two constants that are given: const float stride_length_in_feet = 2.5 ; ...
Use of List with a Singleton Class2/8/2011
  Q: I am trying to explain a scenario which i tried, I have a singleton class, and when the Instance is ...
  A: Yes, you would need to synchronize access to the list. This is the classical producer-consumer ...
Printing out the user's input2/2/2011
  Q: this is what I have so far: // average2.cpp // This program calculates the average of any number of ...
  A: > how can I get the program to printout the users numbers vertically instead of horizontally? ...
Printing out the user's input2/1/2011
  Q: this is what I have so far: // average2.cpp // This program calculates the average of any number of ...
  A: To print out all the numbers entered by the user at the end, you need to store all these numbers ...
C/C++1/22/2011
  Q: #include <stdio.h> #include <conio.h> int f1(int x) { return x*x; } int f2(int y) { return 2*y; } ...
  A: f1(1), f2(2), f3(3) and f4(4) may be evaluated in any order whatsoever. All that we can be sure of ...
A computer mystery1/17/2011
  Q: Vijayan Hope you've been doing well. Ever since I've purchased a new wireless Microsoft mouse for ...
  A: From what I can make out (guess) from your description, it is definitely not a driver problem. There ...
Pointer access for 3D Array1/2/2011
  Q: can we access & modify a 3D array with a single pointer...? Something like this int ...
  A: > can we access & modify a 3D array with a single pointer...? There are no 3D arrays in C++; however ...
C++ pointers array12/31/2010
  Q: I wish to grow a dynamic array of pointers, so i thought of copying the pointers to temp pointers ...
  A: std::size_t array_size = 100 ; int** dyn_array = new int* [array_size] ; for( std::size_t i = 0 ; i ...
C++12/21/2010
  Q: data reading from file displays twice(last record) please help Code Is HERE----------- ...
  A: > #include<fstream.h> > #include<conio.h> > #include<stdio.h> These are not C++ headers; <conio.h> ...
c++ looping12/12/2010
  Q: Sir, thanks for your last reply. However I have I more question of same looping type but is to be ...
  A: > find the sum of the array such that C[1]=A[1]+B[5] > C[2]=A[2]+B[4] I presume that you mean, with ...
c++ looping12/11/2010
  Q: Sir, I have a question related to arrays and loop in c++ its a real simple question you will agree ...
  A: The first element of an array has the subscript zero (0). The expression a[4] refers to the last ...
c related question12/6/2010
  Q: write a function to return value of (a+b)2 given a and b are real numbers please sir, help me to ...
  A: A real number is an abstract mathematical concept; a real number is a value that represents a ...
Binomial Numbers Programming Problem11/24/2010
  Q: You helped someone with the exact same problem last year and it was a great help to me as well, so I ...
  A: Change these two lines // ***************************************************** { binomial(int n, ...
C++ arrays/vector11/19/2010
  Q: i have a program here that is almost finished. But i am in need to implement an array or vector for ...
  A: > " I would suggest reading the assignment scores into an array" Since the number of assignments ...
RE:11/11/2010
  Q: My question to you is that inspite of having C++ why does the world still use C, i mean C++ has ...
  A: Part of the reason is historical - a number of truly great programs, which are still in use have ...
que about Visual C++11/2/2010
  Q: R/Sir Colud you please help me in solving the error in my program's comiplation: Below is the ...
  A: Make sure that you have a file called "resource.h" in the project directory which contains the line: ...
Bisection method10/26/2010
  Q: Newton method; but i will not be succeed and my equation is (x*x+2x-2). n number of iteration in ...
  A: Read these articles. Bisection method: http://en.wikipedia.org/wiki/Bisection_method Newton's ...
converting hex to uintvar10/20/2010
  Q: I'm trying to write code in c++ language using Dev-C++ program. I'm trying to write a program which ...
  A: The algorithm to perform the conversion is already given: "Representing a value as a uintvar: Write ...
C++ HW help10/18/2010
  Q: I have to do a program that converts telephone numbers into letters. If the user enters more than ...
  A: Change the while statement from while (letter != '\n') to while( counter < 7 ) and ...
Different Compilers10/16/2010
  Q: I don't understand what should be done while using different compilers for c++. I learned C++ in ...
  A: > I learned C++ in Turbo C++ IDE If you had based your learning on the DOS based Turbo C++ compiler ...
Basic question regarding C programing7/30/2010
  Q: I am a complete beginner in programing and I have a very basic question. I'm reading one of the ...
  A: > scanf_s("%d, &a"); scanf_s is not part of the C standard library, it is a Micosoftism. Avoid it. ...
password nd username7/27/2010
  Q: i am making a project in which i need the output like dis username : digital password : ***** and ...
  A: There is no standard C++ feature so that characters entered by the user will not be echoed — C++ ...
c++ project title6/15/2010
  Q: we have just finished taking c++ course and asked to come up with a project title which we are going ...
  A: Here's a project that requires nothing more than basic knowledge of C++. Predictive Text Input ...
c++ filing6/8/2010
  Q: i want to know that how can i count the numbers of words, characters ,spaces and lines in a c++ ...
  A: To read each line, use std::getline() http://www.cppreference.com/wiki/string/getline. For example, ...
pendrive detection program6/1/2010
  Q: sir i am planning to do my mini project on anti virus. but i have a problem. i should detect the ...
  A: The way to do this is obviously platform specific. On Windows, you could use the ...
directory5/31/2010
  Q: i am a student of computer science i will try to open a (txt) file in a directory my code is open in ...
  A: The standard C++ library (currently) provides no facilities to iterate through a directory and get ...
IPC ( Shared memory )5/24/2010
  Q: I would like to learn about shared memory implementaion. I have basic idea about that. But, still i ...
  A: Here is a tutorial on using shared memory under unix. http://www.cs.cf.ac.uk/Dave/C/node27.html ...
C++ Object5/24/2010
  Q: In below program, how if condition ( a.data() != "") has succeeded.. if i try ( a != ""), condtion ...
  A: The function data() returns a pointer (const char*) to the first character in the buffer maintained ...
C++ Linkage Errors5/19/2010
  Q: I am new to c++ and I am trying to compile a program thats already available. But, while doing so, I ...
  A: Yes, you do have the header file (.h file) containing the declarations of the exported functions ...
C++ model of PCIe/USB5/19/2010
  Q: Is it possible to obtain a software model of the industry standard interfaces such as PCI Express or ...
  A: Yes, the complete specifications are available. Otherwise they wouldn't be standards, would they? ...
Importance of C++?5/18/2010
  Q: Well to begin with, I admit that my question isnt so clear. But I will try to clarify – I know no ...
  A: > Can u giv examples and explain middlware . Middleware explained: ...
C# vs Java vs C++5/18/2010
  Q: I am a 21 years old guy. Don’t really know much about programming (especially OOP) and software ...
  A: > a few examples of middlewares built in c++. Or applications that are preferably built in c++. ...
C# vs Java vs C++5/17/2010
  Q: I am a 21 years old guy. Don’t really know much about programming (especially OOP) and software ...
  A: At the outset, let me clarify that I have done most of my programming in C++ and Python. I've just ...
c++ is not fully oops based4/22/2010
  Q: can we write a program in c++ without creating class? if yes then is it the only reason which makes ...
  A: > can we write a program in c++ without creating class? Yes, certainly. > if yes then is it the ...
istream4/16/2010
  Q: I'm working on a program that processes either standard in, or a file, depending on an optional ...
  A: On thinking about it later, I've realized that there is an even simpler alternative - use an ...
istream4/16/2010
  Q: I'm working on a program that processes either standard in, or a file, depending on an optional ...
  A: > Maybe instead of setting up a reference to a stream, I should be setting up a reference to a ...
default constructor4/14/2010
  Q: #include<iostream> using namespace std; int a(int,int); class p { public: int i; p() { ...
  A: p ob(p,p,w); Has more than one error. To start with, p and w are classes (types), not objects ...
c++4/13/2010
  Q: I don't know how to write a program which can do this: for exemple n=12367 and in output show me ...
  A: I have already given you the algorithm to do that. int reverse( int number ) { if( number < 0 ) ...
ascii4/13/2010
  Q: I'm new in c++ and I've writen a program which can produce ascii codes.Could you help me how can I ...
  A: > I tried do this with two 'for' but it doesn't work. Of course it will work if you set up the ...
c++4/11/2010
  Q: I don't know how to write a program which can do this: for exemple n=12367 and in output show me ...
  A: Use modulo division by 10 to extract the least significant digit from a number. digit = number ...
A problem while running the program4/9/2010
  Q: I’ve written a program that contains some functions. One of these functions, chseq_r, that I send it ...
  A: > The function is here: > int* chseq_r(int seq[n][kl][hl]) This is not standard C++ and will not ...
How can i evaluate string expression in if statement?4/6/2010
  Q: I want to evaluate string expression in if stmt. E.g. int i = 0,j = 2; char * str = "(i == 0) || (j ...
  A: You will need to write a mini parse to recognize and evaluate the sequence of characters in the ...
Diffrence4/4/2010
  Q: What is the difference in coding in C++ in windows environment and in linux environment ? If their ...
  A: > What is the difference in coding in C++ in windows environment and in linux environment ? As far ...
C++ Hashing Table in Data Structure3/27/2010
  Q: I have some question to ask you regarding this question. This is the question : Write a program to ...
  A: > Then, i should have at least 4 field of records. > Is it means that i will going to make an output ...
am i correct?3/15/2010
  Q: here is a question i tried to solve, could you check my solution and let me know if i am close and ...
  A: > i got no clue how to write a type conversion constructor class A type conversion constructor for ...
am i correct?3/14/2010
  Q: here is a question i tried to solve, could you check my solution and let me know if i am close and ...
  A: class point { int x, y; //add access specifier public: point(int a = 0, int ...
pls hellp me with this code..3/12/2010
  Q: i want a concise code that does this.. i already tried it but not everything and want to see how i ...
  A: Here is how I would do it. You may not have as yet studied all the C++ features used in the program. ...
Merge Sort Question3/9/2010
  Q: Implement the mergesort algorithm in C++ as it sorts the following array into ascending order. List ...
  A: > How would i go about implementing this solution in c++?. see: ...
Developing A Shell3/9/2010
  Q: I have an assignment that I need to do, but I forgot a lot of what I knew about C++. I need to ...
  A: > What exactly is a shell? The term shell originated in the UNIX environment. A shell is a program ...
c++3/6/2010
  Q: I'm new in c++ programing.When I write a simple program in Visual C++ and then I add or delete some ...
  A: I presume that you are using some version of Microsoft Visual C++ IDE. Perform the following steps ...
abit confused3/5/2010
  Q: suppose i have a class given below: class Person { public : Person(const char *Pname , ...
  A: The basic idea is right; you do need to do a deep copy (allocate address for the new spaces and copy ...
C++3/3/2010
  Q: I need to implement an algorithm for using c++ data structures. I have got two files file1 and ...
  A: > parse the file1 for each word and identify the corresponding pattern in patterns1 column. This is ...
c++2/28/2010
  Q: I was looking through the TI website and some of their code. And I tried to compile it on my ...
  A: As the precise compiler error message is unknown to me, here's a guess at the most probable cause: ...
Run c++ exe in Linux2/23/2010
  Q: I have a c++ exe file which successfully run on windows machine. Now i want to reuse the code which ...
  A: g++ is the "GNU C++ compiler", which is standard with linux. For the basics of hoe to compile and ...
Run c++ exe in Linux2/22/2010
  Q: I have a c++ exe file which successfully run on windows machine. Now i want to reuse the code which ...
  A: There is no good way to get the source code from the executable file, and even if it could be done, ...
double link list ; help me..2/21/2010
  Q: Can you help me with this code.. this is actually a single link list..I want to change it to be ...
  A: The next of the node that you are inserting may be NULL. That is, you may be inserting a node at ...
Segmentation fault2/21/2010
  Q: I wrote this code and when i run i get a "Segmentation fault" and it doesn't tell me what line. Can ...
  A: I can't see anything else obviously causing the problem. My guess would be that the data in the ...
Segmentation fault2/21/2010
  Q: I wrote this code and when i run i get a "Segmentation fault" and it doesn't tell me what line. Can ...
  A: There is an obvious error in the function int registered(FILE* fp, int area) ; while ( (fscanf(fp, ...
Operator Overloading2/18/2010
  Q: I have doubt on Operator Overloading fucntions Integer& operator+=(const Integer& other) friend ...
  A: > why i cant do like Integer* operator+=(const Integer* other); Because it violates the ...
concise explanation to this code..2/17/2010
  Q: i was studying a c++ code that demonstrates the increment both prefix and postfix operator but i was ...
  A: Try compiling this code: struct int_array_10 { int_array_10() { for( int i=0 ; i<10 ; ++i ) ...
concise explanation to this code..2/17/2010
  Q: i was studying a c++ code that demonstrates the increment both prefix and postfix operator but i was ...
  A: Let us say we have a function: void our_function( const Array& const_arr, Array& arr ) { ...
concise explanation to this code..2/17/2010
  Q: i was studying a c++ code that demonstrates the increment both prefix and postfix operator but i was ...
  A: > how many constructor is the Time class using? i seen one normal Time(int _hr, int _min) ...
Operator Overloading2/17/2010
  Q: I have doubt on Operator Overloading fucntions Integer& operator+=(const Integer& other) friend ...
  A: > will these functions work for passing and returning pointer No. A pointer in a standard built-in ...
Pointer Initializaton1/24/2010
  Q: I have some basic doubt , Here it is int p=2; int *t=&p; // This will work (Here &p is 3452 ) int ...
  A: int p=2; int *t=&p; // This will work (Here &p is 3452 ) This is fine. t is a pointer to an int; ...
vectorized MD512/10/2009
  Q: I hate to keep bothering you. I am expecting to have more free time over January and was hoping for ...
  A: > 1) is the hash function bugged? or am I doing something wrong? I've not really checked. This had ...
Copy constructor12/9/2009
  Q: 1) what is importance of const. reference object of same class type in copy constructor 2) Why do ...
  A: A copy constructor is used to make a copy of an object. The copy constructor would be used in the ...
two dimensional arrays12/7/2009
  Q: I have to take everything out of the main function and put them into functions. I copied and pasted ...
  A: > I am having trouble figuring out which data types and variables I need to use > when passing the ...
Hello12/6/2009
  Q: Good evening, i have learned C and C++ and know all the basic operations. my question is : is there ...
  A: There is no one book that will teach you all about programming in C++ in a professional way. The ...
Learning visual C++12/5/2009
  Q: , Would you please share your experience about what is the best way to learn Visual C++. I am ...
  A: The version of Turbo C++ you are using is an obsolete version (version 1.01) released in 1991. See ...
Learning visual C++12/5/2009
  Q: , Would you please share your experience about what is the best way to learn Visual C++. I am ...
  A: Visual C++ is just another C++ compiler; all that is to learn about using it are the compiler ...
Arrays12/3/2009
  Q: I have lowered the number of errors down to three. I am not sure if my arrays and statements are ...
  A: There are just two errors in your code. The function void startArrays( string[], int[], ...
c++12/3/2009
  Q: int main(int argc, char *argv[]) { for(i=0;i<argc;i++) {cout<<"\tArgument #"<<i<<": ...
  A: I've already answered this in your first question; reproduced here for convenience: To also convert ...
c++12/3/2009
  Q: int main(int argc, char *argv[]) { for(i=0;i<argc;i++) {cout<<"\tArgument #"<<i<<": ...
  A: > can u tell me how to declare a new in a 2D array of a size entered by user but the columns are ...
c++12/2/2009
  Q: int main(int argc, char *argv[]) { for(i=0;i<argc;i++) {cout<<"\tArgument #"<<i<<": ...
  A: for(i=0;i<argc;i++) {cout<<"\tArgument #"<<i<<": "<<argv[i]<<endl;} The first argument argv[0] ...
explanations about the code pls11/27/2009
  Q: please, i seen this queue implementation in a textbook and i am abit confused about a statement in ...
  A: /*the next statement is what i really dont understand*/ if(tail+1==head || (tail+1==SIZE ...
What is better than RichEdit 4.1?11/27/2009
  Q: I asked this question before, but I am still not clear of the answer. I prefer that instead of ...
  A: > it seems that is the latest version. Microsoft Office always has the more recent (better with ...
RichEdit11/26/2009
  Q: I asked this question before, but I am still not clear of the answer. I prefer that instead of ...
  A: > What is the latest RichEdit version that can be used freely by programmers to make software that ...
passing values by reference11/24/2009
  Q: My program is almost finished ,but I am confused on how to pass values by reference through ...
  A: As a programmer, just think of a reference as another name (an alias) for a variable. For example, ...
what could be wrong with my code?11/24/2009
  Q: please, when i compile and run this code, it crashes. i am guessing it has to do with with my ...
  A: Yes, it has to do with the constructor. In this code fragment, char *str; ...
freind functions11/22/2009
  Q: i have some basic doubt. i have seen some example programms on operator overloading. why operator ...
  A: > can you tell if there is any relation of operator overloading and freind functions? Overloading ...
C++ file handling11/17/2009
  Q: e keyword) stored in one file with the program stored into another file .But the probelm is that i ...
  A: These are not standard c++ headers #include<stdio.h> #include<conio.h> #include<process.h> ...
vectorized MD511/15/2009
  Q: I wasn't sure if I needed to message you before you could message me for the last question. And I ...
  A: I haven't looked into it as yet. I was under the (perhaps mistaken) impression that it was not ...
A question about bank transactions11/15/2009
  Q: first of all I would like to apologise that I am writing to you a private message. But I believe ...
  A: Yes, that should be fine. One issue that you may want to address is that of concurrency - if many ...
A question about bank transactions11/15/2009
  Q: first of all I would like to apologise that I am writing to you a private message. But I believe ...
  A: The structure of your client code is: 1. create a socket => sock = socket( AF_UNIX, SOCK_STREAM, 0 ...
what is wrong with this?11/14/2009
  Q: i am not sure but could it be that i already deleted the memory to store the object cuz i cant ...
  A: The function int neg(dyna ob) takes its parameter by value, it gets a copy of the ...
what is the difference between this two?11/13/2009
  Q: please, here is a working code that displays the binary bit pattern, byte by byte using a union. ...
  A: here is a working code that displays the binary bit pattern, byte by byte using a union. Well, the ...
RichEdit 5.011/10/2009
  Q: I have a programmer who is developing a C++ for me and is doing it in an older version of RichEdit ...
  A: The versions of Rich Edit included in the Microsoft Windows distribution are freely reusable; their ...
Im lost11/9/2009
  Q: I have taken an online course and thus found out for myself that im not all that good with ...
  A: your masterpiece has most of the things correctly done, except change #include < iostream > to ...
c++11/8/2009
  Q: could u pls help mi.i will be so greatly appericated for all the help frm u.my problem is tat i do ...
  A: You need to validate that the string balanceText contains a valid positive number. Write a function ...
c++11/8/2009
  Q: could u pls help mi.my onli problem is the Type.i do knw which part of the code is wrong.i dun knw y ...
  A: In the function Customer::setCustomer, you need to accept the CustomerType and set the member ...
Perfect Number10/22/2009
  Q: A perfect number is a number which sum of all its divisors equals the number. for example for 6, we ...
  A: A Mersenne number is a positive integer that is one less than a power of two. That is, a number of ...
Reference operator10/20/2009
  Q: Can you please tell me "importance of returning reference in operator overloading ? with example" ...
  A: Functions can be declared to return a reference type. There are two reasons to make such a ...
C program10/19/2009
  Q: i have a code running but i want to know, how do i run the program and in the end it asks the user ...
  A: Put the code for your program in a simple loop, which repeats if the user answers 'y' to the ...
vectorized MD510/19/2009
  Q: Sorry. That was a stupid oversight on my part. The code is here: ...
  A: You need to write a main() function, and the linker error will go away - something like this. Not: ...
Software Design10/19/2009
  Q: What makes for good software design?
  A: This is a really open-ended question, isn't it? Somewhat like "What is the meaning of life?". A ...
hi10/17/2009
  Q: #include <iostream> #include <cctype> #include <iomanip> #include <cstdlib> can you explain what ...
  A: #include is a preprocessor directive. As the name implies, the preprocessor operates on the source ...
classes in C++10/12/2009
  Q: I would like to ask you please about classes in C++. I'm trying to basically work with two classes ...
  A: Ok. This is homework, isn't it? I'll help you get going, but you really need to try and complete ...
Memory allocation10/8/2009
  Q: Can you please clarify me what are diff segments? what are the variables stored in these segments? ...
  A: C++ does not specify anything about 'segments', 'RAM', 'ROM' etc. However, in practice, segments and ...
Memory deallocation10/7/2009
  Q: i have one basic doubt , in C++ we will delete the dynamically allocated object but even for normal ...
  A: Where an object (variable) is stored and the life time of the object (variable) is determined my the ...
Linker Error10/7/2009
  Q: Please, tell me what I'm doing wrong with this code... On the Main.cpp file: #include ...
  A: In the definition of classes Personagem, Jogador1 and Jogador2, you have declared constructors. But ...
hi10/3/2009
  Q: For %d minutes: your bill is $%.2f ",hours,minutes,bill);? #include <iostream> #include <cctype> ...
  A: > where would i put printf You do not need printf at all as you are using the C++ stream library ...
result in decimal order9/30/2009
  Q: i want answer in desimal digits. for example. i product two large numbers like (22222 * 33333 = )it ...
  A: You can easily format your output so that fields align correctly, floating point numbers have the ...
constructors9/24/2009
  Q: i have a questions about 'constructors',i actually don't know when should i use them,for example in ...
  A: I would prefer one of: a. Get 'gradesArray' by using cin. And then send it to constructor. b. ...
Object Oriented Methodology9/23/2009
  Q: Difference Between Following Two Statements: String Name = "Radhika"; String Name("Radhika");
  A: Assuming that 'String' is a class which has a (non-explicit) constructor which can be invoked using ...
Padding9/23/2009
  Q: struct X { char ch; int i; char a ; char b; long l; }; First the compiler allots a 4-byte location ...
  A: C++03 provides no standard keyword or function for querying the alignment requirements of types. ...
Padding9/22/2009
  Q: struct X { char ch; int i; char a ; char b; long l; }; First the compiler allots a 4-byte location ...
  A: The C/C++ Standards define alignment as a "requirement that objects of a particular type be located ...
c++9/22/2009
  Q: when i m running this code it is reversing bits properly for 5 or less than 5 number of bits. it is ...
  A: Probably because the maximum value of an int in the C++ implementation that you are using is limited ...
Constructors9/21/2009
  Q: i want to inherit the base class constructors in to my derive class but its failing. struct B1 { ...
  A: As per the current International Standard for C++, base class constructors can not be inherited ...
SSE-accelerated MD59/20/2009
  Q: A four-fold improvement? Yes, I would be very happy with that :) A four-fold improvement over the ...
  A: The program computes the MD5 for 64 million bytes of message data for both the non-sse scalar ...
SSE-accelerated MD59/20/2009
  Q: A four-fold improvement? Yes, I would be very happy with that :) A four-fold improvement over the ...
  A: > What were the benchmarks on your machine? So could you send me some benchmarks? I had given the ...
OS9/20/2009
  Q: can a computer work without an Operating System? if yes, how?
  A: An operating system provides an interface between the hardware and user. It provides management and ...
SSE-accelerated MD59/19/2009
  Q: A four-fold improvement? Yes, I would be very happy with that :) A four-fold improvement over the ...
  A: Let me clarify. MD4 and its successors have been designed with 32bit efficiency in mind. The MD5 ...
SSE2-accelerated MD48/29/2009
  Q: I need help implementing an SSE2-accelerated MD4 implementation. I found one that I think may work ...
  A: > Code is a little convoluted Yes. And I got differences in the MD5 hash (from the results from the ...
heap8/27/2009
  Q: what is the "concept of heap in c++"??
  A: In computer science, a heap is a specialized tree-based data structure that satisfies the heap ...
sequential file8/26/2009
  Q: now i working on searching in sequential file with the key 'ID'.i've used binary_search function. ...
  A: The problem is because after the input of records, std::cin is in an end-of-file state. Any attempt ...
sequential file8/26/2009
  Q: now i working on searching in sequential file with the key 'ID'.i've used binary_search function. ...
  A: There are several issues with this code. 1. The file is first opened for output in append mode ...
some question about c++8/26/2009
  Q: what is the difference between turboc++ & borlandc++ ?
  A: These are the main differences: Turbo C++ Exlorer 2006 (called Turbo hereafter) comes with the ...
Pointers8/25/2009
  Q: How are you.I have some doubts in useing pointers. 1.For every pointer i have to deallocate the ...
  A: 1.For every pointer i have to deallocate the memory or is it for only the pointers who are created ...
sequential file8/24/2009
  Q: I've written a sequential file that can create a file and adding data to it,i'm trying to write a ...
  A: > what exactly does the 'path' argument do? 'path' is the pathname of the file eg. ...
some problems about the friend function in the templated class8/24/2009
  Q: I have designed a templated class about a binary tree which includes a friend functions.But it calls ...
  A: when the compiler sees the friend declaration in class definition friend void ...
sequential file8/23/2009
  Q: I've written a sequential file that can create a file and adding data to it,i'm trying to write a ...
  A: > i think the solution is to put all the records to an array from the file that i have created > ...
c++8/23/2009
  Q: on my syllabus it says"to excute c++ programming assignments some assignments will require use of ...
  A: If your course has specified some prior knowledge as a prerequisite, that is what you should know ...
c++8/23/2009
  Q: on my syllabus it says"to excute c++ programming assignments some assignments will require use of ...
  A: To program in portable C++, you do not need unix - any conforming C++ compiler would do. If the ...
URL check8/23/2009
  Q: How are you? I'm trying to write a program that, among other things, needs to validate a website. ...
  A: The standard C++ library does not provide any facility to do this. You have to use a third-party ...
c++8/23/2009
  Q: could u pls help mi,i realli need your help.i dun knw which part of the code is wrong.when I input ...
  A: There are several logical errors in your program - they would have generated compiler diagnostics, ...
Student Detail Recording System8/21/2009
  Q: i am required to develop a system to record details of student. This system should be implemented ...
  A: a. First define a structure to hold the student information, like this: #include <string> struct ...
SSE2-accelerated MD48/20/2009
  Q: I need help implementing an SSE2-accelerated MD4 implementation. I found one that I think may work ...
  A: The link that you posted gives a 404 NOT FOUND Here are two C++ crypto libraries that I've used. ...
Static Function...8/19/2009
  Q: Vijayan, Have small query about static function and constructor. Basically, static function can ...
  A: A static member function is not an operation on an object instance, it can be called without an ...
strings8/12/2009
  Q: please tell me if i want to use modulas and division operation on strings ten how can i do it. when ...
  A: If the C style string contains only numeric digits, here is one way (error checking has been elided) ...
strings8/12/2009
  Q: please tell me if i want to use modulas and division operation on strings ten how can i do it. when ...
  A: c-style strings are just arrays of characters, terminated by a null character. Among the built in ...
function arguments8/12/2009
  Q: i have designed two functions like void verify(Hvrbuffer *message)--> this will be work when ...
  A: In either case, memory for an object of type is not allocated Hvrbuffer is not allocated or ...
logical problem in c++8/11/2009
  Q: when i am running this code it is not taking input of year.why is this happening and how can i solve ...
  A: > #include<iostream.h> There is no such header in standard C++. use #include <iostream> using ...
c++8/9/2009
  Q: please give me more information about switch case.is it possible to call a function with object in ...
  A: switch(ch) { case 1:rd.getdata_st(); break; case 2:rd.getdata_t(); ...
why is this wrong?8/8/2009
  Q: below i have a working code (version A). if i only change a certain part of the code (version B), i ...
  A: > pls, where is that to b included in my programme bcuz i dont know where to affix those. Just ...
why is this wrong?8/8/2009
  Q: below i have a working code (version A). if i only change a certain part of the code (version B), i ...
  A: #include <string.h> There is no such header in ISO C++. Use #include <cstring> instead. The ...
c++8/3/2009
  Q: could u pls help mi.hw should i truncate a decimal value into a whole number.example:27.56,round off ...
  A: When a floating point value is converted to an integer type, the conversion truncates - that is, the ...
c++simulator8/1/2009
  Q: could u pls help mi.i realli desperate for your help.could u pls c my code,i'm nt sure whether i am ...
  A: Here is a snippet which will give you an idea of what you have to do - this deals with just the ...
c++simulator8/1/2009
  Q: could u pls help mi.i realli desperate for your help.could u pls c my code,i'm nt sure whether i am ...
  A: the running of a discrete-event simulation program is represented as a chronological sequence of ...
more on allocation7/31/2009
  Q: You say that this code below works in C and C++ alike. But it will only work with int or float, not ...
  A: It will compile in C++ with any pointer. In both C and C++, it is semantically incorrect. Correct ...
dynamic allocation7/31/2009
  Q: How are you? I know how to declare dynamically an array of objects of class MyClass: MyClass ...
  A: In standard C and C++, the number of elements in an array has to be a constant known at compile ...
dynamic allocation7/31/2009
  Q: How are you? I know how to declare dynamically an array of objects of class MyClass: MyClass ...
  A: > I know how to declare dynamically an array of objects of class MyClass: > MyClass **array=new ...
Class design7/30/2009
  Q: class X1 { .... }; class X2 { ... }; class X3 { public : X1 *x1; X2 x2; void test (X2 ...
  A: > In this method void test (X2 *x2, X1 &x1); for X2 i can allocate the memory dynamically , but ...
Class design7/29/2009
  Q: class X1 { .... }; class X2 { ... }; class X3 { public : X1 *x1; X2 x2; void test (X2 ...
  A: The member X3::x1 is a pointer. This pointer points to an object of type X1 (which is outside the X3 ...
C++ Memory management7/28/2009
  Q: Can you plz tell me how the memory management will happen in C++ ?. we have stack,heap , code ...
  A: Functions (code) is stored in a part of memory which is separate from that of variables (also called ...
doubt in function argument passing7/28/2009
  Q: 1."Pass by value , Pass by reference ,Pass by address in these 3 types of parameter passing, which ...
  A: Only pass by value creates a new object of that type. Pass by address passes a copy of the address, ...
when to use pointers & Referencs7/27/2009
  Q: I have some basic questions. I have worked in java for 1 year.Now i moved to C++, Here i am getting ...
  A: When i have to create pointer object and normal object? Use a normal (named) object in all ...
fibonacci7/23/2009
  Q: i've written a nonrecursive fibonacci function and my purpose is to finding the largest fibonacci ...
  A: When there is an integer overflow, the bits overflow into the sign bit of the integer and it becomes ...
default arguments7/21/2009
  Q: i have a question about default arguments in c++. could you plz tell me what's the implication ...
  A: Any parameters after a parameter having a default argument value must have default argument values. ...
allocation7/17/2009
  Q: I have this loop in my program where I repetedly create an array of pointer to class MyTree ...
  A: You do not have to, and you can not, do anything to release the memory occupied by the array - it ...
Data Types7/16/2009
  Q: I'm having some trouble understanding some data types and operators in C++, can u help answer these ...
  A: why j + 100 is discarded when 999 + j is remained, The language specification states "expressions ...
Data Types7/16/2009
  Q: I'm having some trouble understanding some data types and operators in C++, can u help answer these ...
  A: 1) What is the advantage of enumeration? Why using it when I can just use integer to replace it? An ...
still on the struct and class problems7/9/2009
  Q: ok, i will try to write the functions and let u see them, now i get to understand something totally ...
  A: There is no difference at all except for the default access specifier. Members of a struct are ...
definition of a Class7/9/2009
  Q: coould you help me out with this problem by partially giving functions to be included in the class ...
  A: You can have constructors as well as access specifiers (you can have anything that you could have in ...
definition of a Class7/8/2009
  Q: coould you help me out with this problem by partially giving functions to be included in the class ...
  A: A struct and class are synonyms in C++, they differ only in the default access specifier. from the ...
definition of a Class7/8/2009
  Q: coould you help me out with this problem by partially giving functions to be included in the class ...
  A: something like this, perhaps. struct entry { entry( const char* wd, const char* expl ) ; // ...
hash tables, fast hash lookup6/15/2009
  Q: In follow up to the question I asked you earlier ("fast vector lookup"): Yes, I was able to get ...
  A: You need to use the struct sixteen_byte_hash for *both* insert and lookup. To make your task easier, ...
enumuration values6/12/2009
  Q: could you plz tell me that are enumuration values coerced to integer?or are any other types coerced ...
  A: An enumerated type is used to express the idea that a variable will be used for a specific purpose ...
hash tables, fast hash lookup6/5/2009
  Q: In follow up to the question I asked you earlier ("fast vector lookup"): Yes, I was able to get ...
  A: First, use a structure to hold your 16 byte (128 bit) digests. enum { NBYTES = 16, NWORDS = NBYTES ...
fast vector search6/4/2009
  Q: This is a follow up to a question I asked you earlier about reading wordlists into memory. Yes, I ...
  A: > dense_hash is just a super-fast vector. No, dense_hash is a super-fast hash table implementation. ...
data structures6/3/2009
  Q: How are you? Thank you very much for taking questions. I am experimenting with linked lists and ...
  A: You could use a linked list instead of an array (as in your earlier code). If the only issue is ...
variables definition6/2/2009
  Q: could you please tell me about the difference between data member and class variable and also ...
  A: #include <iostream> struct account { double balance_amount ; // instance data member variable ...
c++5/31/2009
  Q: my problem is the makeHeap function,i gt many errors,which i do nt understand.could you pls help ...
  A: To be const-correct, void printList(sales *arr, int num) ; should be void printList( const sales* ...
c++5/31/2009
  Q: my problem is the makeHeap function,i gt many errors,which i do nt understand.could you pls help ...
  A: you have a struct, which, IIRC, is this: struct sales { char id[10]; float sales; }; I think ...
c++heapsort5/29/2009
  Q: Write a main program that reads in the data, populating an array and sorts the array (in descending ...
  A: It is much easier to write the function recursively. struct sales { char id[10]; float sales; ...
data structures5/28/2009
  Q: How are you? Thank you very much for taking questions. I am experimenting with linked lists and ...
  A: The problem is in your set_left() and set_right. These need to modify the variable of the caller. ...
Computer Studies pseudocode algorithm5/27/2009
  Q: i recently just wrote a computer studies exam where i was asked to write a simple algorithm in ...
  A: You require only one loop. init: sw_flights <- 0 kn_flights <- 0 fa_flights <- 0 loop: ...
data structures5/27/2009
  Q: How are you? Thank you very much for taking questions. I am experimenting with linked lists and ...
  A: if we need a variable number of objects that can only be determined during run-time, we have to ...
f.obj : error LNK20195/26/2009
  Q: Vijayan, I'm working on a project for a C++ class and it will compile, but I'm getting linking ...
  A: A linker error LNK2019 means that there is at least one unresolved external symbol; you have ...
fast vector search5/26/2009
  Q: This is a follow up to a question I asked you earlier about reading wordlists into memory. Yes, I ...
  A: Preliminary investigations suggest that a google dense_hash_set is a good choice as a hash table ...
fast vector search5/25/2009
  Q: This is a follow up to a question I asked you earlier about reading wordlists into memory. Yes, I ...
  A: Ignore any earlier reply you might have got - I think I hit the wrong key by mistake. "the goal of ...
c++linked list5/23/2009
  Q: my problem is still the insetStudent function,still many errors.and there is also an error in the ...
  A: #include<iostream> #include<fstream> // ************** modified ******************** // removed // ...
c++linked list5/23/2009
  Q: my problem is still the insetStudent function,still many errors.and there is also an error in the ...
  A: I repeat: Modify the first declaration of insertStudent() from void insertStudent( studentNode*& ...
c++linked list5/23/2009
  Q: my problem is still the insetStudent function,still many errors.and there is also an error in the ...
  A: -In constructors 'studentNode::studentNode char*,int,int,int,studentNode*) -18:error:anachronistic ...
c++linklist5/23/2009
  Q: my problem is the insertStudent.hw do i change it,for the studentid it has to be char *no instead of ...
  A: > i hv nv learn tis code (explicit) at all.is there another way of writing the code without the ...
c++linklist5/22/2009
  Q: my problem is the insertStudent.hw do i change it,for the studentid it has to be char *no instead of ...
  A: The function printStudentList() is easy - just iterate through every studentNode in the list, ...
c++linklist5/22/2009
  Q: my problem is the insertStudent.hw do i change it,for the studentid it has to be char *no instead of ...
  A: Use a std::string to store the student id. see http://www.cprogramming.com/tutorial/string.html ...
c++linkedlist5/20/2009
  Q: Write a C++ program to read in a set of data from a text file which contains the student number, ...
  A: Make the student number an int, not a char. Write a constructor for studentNode. Write a convenience ...
Header file5/18/2009
  Q: I have a question about the below,can you tell me whats the problem with it that every time i ...
  A: The error is self-explanatory - the preprocessor can not find the file "GradeBook.h" Generally, it ...
display number structure??5/16/2009
  Q: In my array arr={10,20,30,40} i want to display output like 10 20 30 40 10+20 10+30 10+40 20+30 ...
  A: The simplest way is to write a recursive function. for example: #include <iostream> #include ...
display number structure??5/16/2009
  Q: In my array arr={10,20,30,40} i want to display output like 10 20 30 40 10+20 10+30 10+40 20+30 ...
  A: In a C++ program, prefer using C++ functions for io. Avoid <conio.h>, it has never been a standard C ...
getline()5/15/2009
  Q: my question is about the code below.when i run the programme after that i enter nameofcourse why it ...
  A: std::istream& std::getline( std::istream& stm, std::string& str, char delimiter = '\n' ) ; reads a ...
std5/14/2009
  Q: i have a question about using std in c++ programming,for instance using 'std::cout' , 'std::cin' or ...
  A: If the only programs that were ever written were only by one person, things like namespaces probably ...
writing at specific locations in a .txt file using c++5/13/2009
  Q: I have a text file(.txt), it contains 10000 lines (decimal values with + and -) continous of fixed ...
  A: The simplest way to do this is: a. read the original file line by line b. write out each line read ...
FILE5/2/2009
  Q: i have written the code below,it works correctly,but my question is that why when i delete the line ...
  A: fopen("c:\\text.txt","r+"); opens the file for reading and writing. The stream is positioned at ...
reading wordlist words into memory4/30/2009
  Q: I am writing a program which will access a wordlist file and check every word in that file to see if ...
  A: > Am I correct in understanding that the entire wordlist has been loaded into memory? Yes. > The ...
reading wordlist words into memory4/26/2009
  Q: I am writing a program which will access a wordlist file and check every word in that file to see if ...
  A: > The wordlist file has millions of words, and I cannot be sure > of the length of them (thus char ...
c++4/23/2009
  Q: could you pls help mi!!!i do nt knw which part of my code went wrong.wen i run the program,it onli ...
  A: > i want the text file to be able to read a blank space. You can leave a blank space space in ...
c++4/23/2009
  Q: could you pls help mi!!!i do nt knw which part of my code went wrong.wen i run the program,it onli ...
  A: In you data file, ACCADDEBBABAADCCAEAA Jack ACBADDE BACBADCBAEBA Angie CCBAEEA BBACDDEDEBCC ...
Do While Loop Problem4/23/2009
  Q: To start off, i'm very new so this could be an easy fix. I use dev C++. let me just put the code. ...
  A: change do { // ..... } while( answer != "Raleigh" || answer != "raleigh" ) ; to ...
horner's method4/21/2009
  Q: i have a project in c++,it is about horner's method,and the program should run it. but i don't know ...
  A: Horner's method is a technique for evaluating polynomials. It uses nested multiplication instead of ...
loop4/20/2009
  Q: I was the following... Write a program that displays a menu with the following choices to the user. ...
  A: revision: change to public to find the largest number entered by a user, you do not need to store ...
call by refrence4/17/2009
  Q: i have a question about calling variables in functions could you plz tell me what's the diffrence ...
  A: > the address of 'a' will be change the address of 'a' will never change. once an object is ...
data structures4/15/2009
  Q: i actually need to make a project in which i have to make a programme in c++ in which i have to ...
  A: A good place to learn about a simple way of doing this is to read the section on implementing ...
i need help in my assignment4/11/2009
  Q: my assignment talking about string manipulation and he needs a menu of 11 : 1. Inputting new string ...
  A: 1. Inputting new string assuming that 'Inputting new string' means read a line of text, use ...
file in c4/9/2009
  Q: i want to learn about file code,i wrote the fallowing code it doesn't have error but doesn't work ...
  A: > it doesn't have error but doesn't work that it compiles is no guarantee that it will not fail at ...
dev c++4/9/2009
  Q: i am a student trying to learn dev c++ and i am having trouble making a program. the program ...
  A: first declare an array that can hold six numbers enum { ARRAYSIZE = 6 } ; int numbers[ARRAYSIZE] ; ...
C SOLUTION4/5/2009
  Q: recently i came across this question in our campus interview. which i dint clear. they dint gave the ...
  A: "Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big ...
question4/2/2009
  Q: write a program that reads in a sentence of up to 100 characters and outputs the sentence with ...
  A: to read in a sentence, read character by character till a period is encountered. std::string ...
a question4/1/2009
  Q: i want to write a programme that shows all combination of 'n' variable,for instance for two variable ...
  A: > for instance for two variable 'a' and 'b',it prints:"aa","ab","ba","bb" "ab" is a different ...
C++3/18/2009
  Q: I need to find all the numbers that are perfect square between 1000 and 9999 and the first 2 digits ...
  A: to find all numbers between 1000 and 9999 which are perfect squares, a. determine the integer a ...
floating point value3/18/2009
  Q: I want to know how can we print only the magnitude of any floating point value that is assigned to a ...
  A: this is easy, isn't it? one way is to print -a if a is negetive, +a otherwise. another way is to ...
query in c++(about random() function)3/12/2009
  Q: what output will this code produce? main() { randomize(); char ...
  A: > what output will this code produce? a cascade of compiler errors. error: ISO C++ forbids ...
C++ While Loop3/10/2009
  Q: I am trying to build a shopping program for my daughter but I'm stuck! Could you help me out? Here's ...
  A: > What I would like to do is form a loop ... up until a negative price value is entered the simple ...
I/O port programming3/7/2009
  Q: How are you? I would like to start learning I/O port programming. I'd like to write software that ...
  A: there is a fair amount of literature available. these are some books that have been well spoken of: ...
hello3/5/2009
  Q: 1-I want to know why we put constant in this line(char* dest,const char*src) although if we dont put ...
  A: > why we put constant in this line strcpy( char* dest, const char* src ) because the source of the ...
c++ not working3/5/2009
  Q: actually this question not regarding code. i copied a c++ software from my friend a few days ago. ...
  A: > can you tell me how to fix the problem? i might be able to tell you that if i know a. what the ...
Command line3/3/2009
  Q: Could you please critique my code? It keeps getting wrong output, and I don't know why. It is a ...
  A: one immediate problem i can see in your code is: for (int i=0; i<=n; i++) { if( i%n == 0 ) ...
c++ & c#3/3/2009
  Q: Drawbacks of exception handling in c++ & c#.
  A: i am not a C# programmer; so the following comments are for C++. in any case, languages like C# and ...
Priority3/2/2009
  Q: By priority of each expression I mean for instance '*' has a higher priority than "-". I appreciate ...
  A: > The problem is that I don't know how to come up with the code that checks the priority... that is ...
Priority3/2/2009
  Q: By priority of each expression I mean for instance '*' has a higher priority than "-". I appreciate ...
  A: your comments indicate that you are on the right track; to take care of precedence, you need to ...
Priority3/1/2009
  Q: By priority of each expression I mean for instance '*' has a higher priority than "-". I appreciate ...
  A: let us say we have a grammar in which integer numbers and the binary operators +, -, * and / are the ...
My new programming language2/28/2009
  Q: Sir, I'm creating a new programming language using C++. The idea is to write a C++ program that can ...
  A: > When the program is executed for the first time it shows errors for > the correct program & it ...
Counting Inversions2/24/2009
  Q: I am trying to find the number of inversions using merge sort, but I am having trouble counting up ...
  A: well, the function MergeSort does seem to return the number of inversions. i haven't gone through ...
C++ classes2/22/2009
  Q: I am trying to do a C++ program with 2 classes Employee and Company. Employee has a member function ...
  A: the array employee_collection contains *pointers* Employee objects, not the objects themselves. so ...
C++ classes2/21/2009
  Q: I am trying to do a C++ program with 2 classes Employee and Company. Employee has a member function ...
  A: > Employee has a member function called getempID ... > char* Employee::getempID() > { > return ...
C++2/16/2009
  Q: I have tried to develop a C++ program that read information of employees using project, I only ...
  A: a. have an array of 100 employees and a variable to hold the number of employees. enum ...
c++text file2/13/2009
  Q: the program prompt user to enter the filename of a text file and number of columns(width).It will ...
  A: > All lines will terminate with a Carriage Return(CR) and Line Feed(LF) this is incorrect (at the ...
Stack question2/13/2009
  Q: I asked you a Java Q before and you got me started pretty well. I've already asked the Java people ...
  A: right from jdk 1.0, java has has a built-in stack class java.util.Stack ...
C++ converting roman to decimal2/13/2009
  Q: In Programming Exercise 1 in Chapter 11 (D.S. Malik, 4th edition), we defined a class romanType to ...
  A: Rules regarding Roman numerals sometimes state that a symbol representing 10^n may not precede any ...
extract characters after a space in a string2/7/2009
  Q: How do I extract a word after a space in a string?
  A: the simplest way is to use a stringstream. for example, #include<string> #include<iostream> ...
doubt in c++2/7/2009
  Q: How to extract contents of a file in c++ using linux compiler?
  A: firstly, C++ conforms to an International Standard and io can be performed in a platform independant ...
Divisors program confused?2/6/2009
  Q: I want to write a program that finds how many divisors a number has, and displays what those numbers ...
  A: to break up the problem into two smaller subproblems: problem a. check if a number is the divisor ...
problem in c++2/6/2009
  Q: what to do if an error "unable to open file iostream .h" is displaying and how to change or correct ...
  A: <iostream.h> is not (and never has been) a standard C++ header. many compilers still support it ...
Beginning a Programming language2/6/2009
  Q: I am still in High School and would like to learn a programming language. I feel it would help me ...
  A: I would recommend lisp. You are still in high school, you would get an opportunity to learn ...
set method2/5/2009
  Q: This would be my last question I promise :) Again having in mind the following are my data members: ...
  A: you need to adjust the size to reflect the new element which has been added. public void ...
TrimToSize() method2/5/2009
  Q: You helped me earlier with my Java code a little. I have asked the java quys but they haven't got ...
  A: trimming the array should a. create a new array of *size* (not objects.length-size) elements b. copy ...
Tree Templates2/4/2009
  Q: we are working on Multi Target Tracking Project, for that we need to create some tree templates ...
  A: well, what kind of a tree do you want? here is an AVL-Tree implementation: ...
compiler of C++2/3/2009
  Q: what is the compiler of C++ language? does C++ uses any interpreter also? is the compiler and ...
  A: Turbo C++ is a C++ compiler and integrated development environment (IDE) from Borland. its compiler ...
compiler of C++2/2/2009
  Q: what is the compiler of C++ language? does C++ uses any interpreter also? is the compiler and ...
  A: > what is the compiler of C++ language? see: http://en.wikipedia.org/wiki/Compiler C++ is a ...
file2/2/2009
  Q: i have writen a class and then i have writen another class using an object of the first class! now i ...
  A: use a std::ofstream to write to a file and a std::ifstream to read from a file. see: ...
request2/2/2009
  Q: sir, i m researh scholar pursuing phd. i m working on object-oriented software development. i m ...
  A: you could freely pick up this information for any open source project. i presume that to really ...
Array of Objects2/2/2009
  Q: From your profile I kind of guessed that you may probably know Java as well! so I have a Java ...
  A: > I kind of guessed that you may probably know Java as well! i am not a java programmer; i do not ...
lottery numbers1/31/2009
  Q: It has been a while since i have done any work with c++ and i was wondering if you could help me out ...
  A: represent each ticket as an array of 6 numbers. and since we have 150 tickets, have an array ...
problem in reading from a file1/29/2009
  Q: I am making a project for my practicals which is a game in which the admin can enter questions and ...
  A: #include<fstream.h> #include<conio.h> #include<stdlib.h> #include<stdio.h> #include<string.h> none ...
Algorithm1/26/2009
  Q: If a problem belongs to P class then can it belong to NP class? Answer according to current research ...
  A: The typical question in in computational complexity theory is, "As the size of the input to an ...
Unix like programming help needed1/21/2009
  Q: I need help in the following please: I know that in unix like systems there is only one ALARM ...
  A: Signals are notifications sent to a process in order to notify it of various events. they interrupt ...
about writing and reading to disk1/21/2009
  Q: suppose i have a class Person. that prints a person's name and the number of brothers that person ...
  A: instead of using std::cin for reading and std::cout for writing formatted output, use a ...
divide and Conquer Algorithm1/21/2009
  Q: I have created a Recursive and NonRecursive algorithm for calculating the sum of integers. I've ...
  A: The basic idea behind a recursive function is that you can solve a problem by breaking it into ...
more efficient?1/20/2009
  Q: could you tell me which one is more efficient and why please? if (a && b) f1(); else f2(); or if ...
  A: the two forms are not equivalent. form one is: a b result -- -- ------ T T ...
better code?1/20/2009
  Q: I'm new at programming but my teachers say that we need to practice to write better codes. How could ...
  A: loop unrolling (as in the example above), is a technique that attempts optimize a program's ...
C++1/19/2009
  Q: Write is copy constructor?write its types?Also explain it with the help of example?
  A: this is already answered at many places. for example, see: ...
help me plz1/2/2009
  Q: can you please help me with this code below,i want this to put the returning value of the token ...
  A: main *must* return an int. the int returned by main() is a way for a program to return a value to ...
Entity / relationship Diagram1/1/2009
  Q: Entity / relationship Diagram I know this is totally off the topic but was just wondering if you ...
  A: this is the mit opencourseware page: http://mit.nelc.edu.eg/OcwWeb/index.htm ...
Entity / relationship Diagram1/1/2009
  Q: Entity / relationship Diagram I know this is totally off the topic but was just wondering if you ...
  A: relationships between entities which fall into three types: one to one: example => diploma - ...
Thread mutex question1/1/2009
  Q: I know this question is not related to your field but I figured you may be able to help me on this ...
  A: glad you could solve this yourself by realizing that you need to link with libpthread. ideally, you ...
Thread mutex question12/30/2008
  Q: I know this question is not related to your field but I figured you may be able to help me on this ...
  A: ok. read these pthread tutorials first. https://computing.llnl.gov/tutorials/pthreads/ ...
Thread mutex question12/29/2008
  Q: I know this question is not related to your field but I figured you may be able to help me on this ...
  A: the current c++ standard (c++98) has no library support for threads; you have to rely on threading ...
problem with linklist12/25/2008
  Q: i have a problem in this code below.i want to write a linkedlist that "head" always points to the ...
  A: a[i]=b[j] ; copies the char at position j in string b to the char at position i in string a. ...
problem with linklist12/25/2008
  Q: i have a problem in this code below.i want to write a linkedlist that "head" always points to the ...
  A: in C, a string is an array of characters (memory containing a sequence of characters) ending in a ...
shared constant base class/derived class dilemma12/23/2008
  Q: My question is about how to do something that should be simple, but classes/inheritance doesn't seem ...
  A: > initializing the constant string in a method wouldn't work from the constructor or Initialize() ...
shared constant base class/derived class dilemma12/22/2008
  Q: My question is about how to do something that should be simple, but classes/inheritance doesn't seem ...
  A: have a virtual function virtual const char* filetype_string() const = 0 ; in the base class. ...
problem with linklist12/22/2008
  Q: i have a problem in this code below.i want to write a linkedlist that "head" always points to the ...
  A: you need to allocate a separate node for each element in the linked list. the link for every node ...
c++12/15/2008
  Q: What is core language and why is c++ called a core language?
  A: in computer programming, the 'core language' is the definition of a programming language (sometimes, ...
still on my increment operator12/12/2008
  Q: I have the code this way but when i compile and run the programme, it's doing nothing. supoose i ...
  A: > when i enter a time say : 12:05 it's giving me zeroes the code as it is will work as expected if ...
Static Function12/11/2008
  Q: I need some clarification about static functions. I have basic idea about static function but my ...
  A: no, IS 12.8/15 allows this kind of optimization at any place where it recognizes that the following ...
still on my increment operator12/11/2008
  Q: I have the code this way but when i compile and run the programme, it's doing nothing. supoose i ...
  A: there is an error in the overloaded prefix increment operator: the time is incremented twice. Time ...
Static Function12/10/2008
  Q: I need some clarification about static functions. I have basic idea about static function but my ...
  A: Temp Temp::make() { return Temp(); //While retuns copy constructor been involved or not } ...
Even when I include cstdlib.12/9/2008
  Q: Okay I did have include <cstdlib> and it still won't run and gives the "expected constructor ...
  A: > Here's your way: #include <ctype.h> // ... int main() { // ... } ...
compilation error12/8/2008
  Q: There is an error when compiling: I've run the program and it points to system("pause"); and the ...
  A: the system() function is declared in <cstdlib> or <stdlib.h> in C. you need to #include the header. ...
here's the code12/8/2008
  Q: okay here it is. i just want it to get over with. #include <cstdlib> #include <iostream> #include ...
  A: ok. here are the errors in the code. 1. the gender string has to be accepted from the user. add ...
same problem again.12/7/2008
  Q: i'm really sorry. But the problem is I want the user to input characters with only m and f as well ...
  A: modify if( ( gender != "male" ) && ( gender != "female" ) ) { std::cout << "gender is ...
Still a problem.12/7/2008
  Q: Hey. I've attempted your code. But there's still an error. I want to try all the possibilites like ...
  A: ok. since you want to accept complete strings (and not just a single character), modify your loop to ...
any idea pls12/7/2008
  Q: i was studying the post increment and preincrement operator overloading in the c++ language. I ...
  A: > so that if i enter 10:00 as time, and i want it to print time++(post incremnt), that gives 10 ...
Hey again.12/7/2008
  Q: I understand c++ upto using strings and functions. What about like asking the user to output male or ...
  A: > Isn't there a way to find out without using algorithms but just using if, while or do loops and ...
any idea pls12/7/2008
  Q: i was studying the post increment and preincrement operator overloading in the c++ language. I ...
  A: before we come to the prefix and postfix increment operators, a few issues first: a constructor ...
Hello PLEASE HELP.12/6/2008
  Q: I wanted to know if you could give me the code using strings for a name. What I mean is for example: ...
  A: the standard C library function isdigit(int) in the header <ctype.h> returns non-zero (true) if its ...
Bank Account program in C12/5/2008
  Q: Apologies for not being clear in my previous e-mail. Below is an answer to a question you sent on ...
  A: ok. here is my way of writing this program. (there are several other ways to do it). *** warning: ...
plz help12/4/2008
  Q: in this code below in the line that i have signed i don't know why it just print the value x=1 and ...
  A: void BUG( int x, int y ) ; function BUG takes the parameters by value. what bug gets are copies ...
constructors12/3/2008
  Q: For the following prog u get the output as: 00000 01010 I don't understand why.. Just explain me ...
  A: this is a serious technical blunder. class Base { // ... }; class ...
help me plz11/30/2008
  Q: i have a problem whit the code below,in the rows that i have signed the code i want the program to ...
  A: you are causing a buffer overflow for the array mark int mark[10][10],m,n; void main() { int ...
plz help11/29/2008
  Q: can you give me a code wrote with rnd function for choosing a number between 1-10? i really get ...
  A: rand() returns an integer between 0 and RAND_MAX (inclusive). the constant RAND_MAX is ...
plz help11/29/2008
  Q: can you give me a code wrote with rnd function for choosing a number between 1-10? i really get ...
  A: rand() returns an integer between 0 and RAND_MAX (inclusive). the constant RAND_MAX is ...
Physica11/29/2008
  Q: Sir, Let me know how can I perform PC parallel port interfacing experiments in C++ in windows XP ...
  A: depends on the functions that you used in the code for windows 98. it may be possible to use the ...
plz help11/27/2008
  Q: i have a problem about the code below it has an errrore for the push function ,it is"error C2601: ...
  A: a brace is wrongly placed. a closing } in main is missing and push has an extra } void push(struct ...
Heritage Question11/26/2008
  Q: Below is an example I took from a book. Could you confirm that out of those 8 statements below, only ...
  A: i presume, you intended class Derived : public Base { .... }; and that Base and Derived are ...
changing a for loop to a while loop11/25/2008
  Q: I was told that we should be able to make a while loop from a for loop, is that true? I have tried ...
  A: the for statement provides a compact way to iterate over a range of values. programmers often refer ...
Complexity of Algorithms11/25/2008
  Q: Could you tell me how to find Complexity of Algorithms of the functions add and extract? also if you ...
  A: if you mean, a function that sorts an array using FilePrio: if the number of elements in the array ...
Complexity of Algorithms11/25/2008
  Q: Could you tell me how to find Complexity of Algorithms of the functions add and extract? also if you ...
  A: function add has to execute a loop (the while loop for determining the position of the item in the ...
copy constructor and assignment operator11/24/2008
  Q: could you tell me the difference between copy constructor and the assignment operator? I guess the ...
  A: > could you tell me the difference between copy constructor and the assignment operator? a copy ...
copy constructor and assignment operator11/24/2008
  Q: ) I still have some more questions there which I commented on the code. Also if we were to write a ...
  A: // let's say we have 5, 10, 11, 12 and our t is 7 template <typename T> void FilePrio::add( const ...
add/delete an element11/24/2008
  Q: You're my favorite expert on this site, I'm glad you're back from vacation :) I am trying to do ...
  A: emplate <typename T> void FilePrio::add( const T& t ) { // don't we need to add someting like if ...
add/delete an element11/24/2008
  Q: You're my favorite expert on this site, I'm glad you're back from vacation :) I am trying to do ...
  A: i am guessing, the intent seems to be: template <typename T> class FilePrio is a singly linked list ...
C++ Programming11/24/2008
  Q: two one-dimensional arrays A and B which are stored in assending order.to merge them into a single ...
  A: here is a simple non-recursive pseudocode implementation to merge two arrays a, b into array result: ...
prime numbers11/21/2008
  Q: im given an assignment in which the user is to enter the number of prime numbers to be displayed and ...
  A: > i know how to check if a number is prime if you know that, the rest is trivial. a. you would be ...
plz help11/20/2008
  Q: i want to learn graphic programming in c++ visual studio,can you help me which language i should ...
  A: the learning curve for graphics programming is fairly steep. you should be prepared to invest time ...
testing all the functions11/16/2008
  Q: you were right, I wasn't compiling the right file! thanks :) Do you believe that my test program ...
  A: the basic idea of testing is to try and discover errors. in general, you would get the best return ...
test program11/16/2008
  Q: it's me again :) could you also please help me to come up with a test for operator++ and ...
  A: > are there any side effects of having everything in .h file in my case( list.h) or in general? in ...
test program11/16/2008
  Q: it's me again :) could you also please help me to come up with a test for operator++ and ...
  A: > is "firstElement = 0 ; " same as "firstElement = NULL ; "? yes, in C++ the definition of NULL is ...
test program11/15/2008
  Q: it's me again :) could you also please help me to come up with a test for operator++ and ...
  A: > I understand the difference between the prefix and postfix but don't know how to test them! there ...
typename template11/15/2008
  Q: the link you sent me was excellent. thank you so much :) Could you explain the difference between ...
  A: in template < typename T > void List<T>::Iterator::next() { position = position->next; } the ...
testing the code11/15/2008
  Q: I did as you suggested and it is working now :) could you help me to come up with a test program ...
  A: a 'container' or to be more precise, a 'sequence container' is a class that holds a. a collection of ...
testing the code11/15/2008
  Q: I did as you suggested and it is working now :) could you help me to come up with a test program ...
  A: everything in the C++ standard library resides in the namespace std. std::cout, std::string, ...
testing the code11/15/2008
  Q: I did as you suggested and it is working now :) could you help me to come up with a test program ...
  A: the paste bin seems to be a good idea. the code is much more readable that it would be if you place ...
C++ internal class11/14/2008
  Q: Below I pasted my list.h file for you to see. I am a newbie in C++. My template classes work fine ...
  A: templates are a pure compile-time mechanism. the compiler needs to see the template code for any ...
plz help11/14/2008
  Q: i wrote the code below but i have a problem with the first function,for example we enter m=1 and ...
  A: the Ackermann function is a general recursive function. And you can implement it with three ...
C++ internal class11/14/2008
  Q: Below I pasted my list.h file for you to see. I am a newbie in C++. My template classes work fine ...
  A: since the List<T> and List<T>::Iterator needs to use the name Element<T> and Element<T> needs to ...
plz help11/14/2008
  Q: i wrote the code below but i have a problem with the first function,for example we enter m=1 and ...
  A: > can you check it out,and tell me if there is another way or easier way for correcting it? it is ...
C++ internal class11/14/2008
  Q: Below I pasted my list.h file for you to see. I am a newbie in C++. My template classes work fine ...
  A: all you have to do is declare/define the class Iterator within the List<> class. the template ...
plz help11/13/2008
  Q: i wrote the code below but i have a problem with the first function,for example we enter m=1 and ...
  A: You can treat the arguments of a function as variables, however direct manipulation of these ...
C assending integers alghorithm11/13/2008
  Q: I have a mid-term coming up on C. One of the practice problems was to ask the user for 3 integers ...
  A: void swap( int* a, int* b ) { int temp = *a ; *a = *b ; *b = temp ; } int main() { ...
C assending integers alghorithm11/12/2008
  Q: I have a mid-term coming up on C. One of the practice problems was to ask the user for 3 integers ...
  A: from the question, i presume that you have not yet come to arrays or functions. if that is the case, ...
c program help11/11/2008
  Q: Writing a C program (call it RandPass.c) which can generate such passwords from 6 to 12 characters ...
  A: 1. write a function to generate a random printable character a. generate a random int in ...
text file processing11/11/2008
  Q: Could you please take a look at my code? I cannot figure out why my code is displaying incorrect ...
  A: > I'm pretty sure the error is in my while loop. yes, your while loop has a subtle error in handling ...
while loop Question ??11/4/2008
  Q: Write a program that estimates the value of the mathematical constant e by using the formula: e = ...
  A: indent your code. makes it much easier to read and modify. unless you are using an obsolete ...
c++11/3/2008
  Q: Plz give me Project proposal for any game.
  A: if you are in the process of learning programming, the game that you program should a. be easy to ...
overloading << and >> operators11/3/2008
  Q: Vijayan I know that in order to overload the << and >> operators I must do sth like this inside my ...
  A: the overloaded << operator is used by the compiler this way. note: C++ streams are not copyable; ...
c++timetable10/28/2008
  Q: tis is the code i wrote for constructing the timetable could u pls help mi!!!i do nt knw why my ...
  A: the approach is right. but the basic problem with your code is: a. the use of uninitialized ...
lexicographical_compare9/30/2008
  Q: I would like to know what is Leaxicographical_compare? I want to implement in linked list for ...
  A: The name of the lexicographic order stems from the order given to words in a dictionary: a sequence ...
errors9/28/2008
  Q: what is difference between compile time error and run time errors???????????
  A: A compile-time error is an error that the compiler gives when compiling your code. For example, the ...
I need help with a C program please.9/25/2008
  Q: I'm a complete newbie to C programming and I need help writing a program. The program should do the ...
  A: You are almost there. Here is an outline of what you should do: #include <stdio.h> int main(void) ...
how to make a project of library9/24/2008
  Q: sir i want to make a program of library where i want following points to be included: 1.store the ...
  A: implement the classes: date - keep a calendar date eg. 12 june 2009 title - the book title eg. ...
.dlls in c++9/18/2008
  Q: what are dll files? are they different in windows and turbo environment? how are they created and ...
  A: > what are dll files? a library is a collection of subroutines used to develop software. Libraries ...
What is signal?9/18/2008
  Q: Hey thanks for ur reply to my earlier question. there are two functions available ,signal() and ...
  A: A signal is a limited form of inter-process communication used in Unix, Unix-like, and other ...
STL::iterator9/17/2008
  Q: I have read source as to how to make own iterator for linked list. I have some problem while ...
  A: the error message is self-explanatory: 'A reference return value must be an lvalue' 0 is a literal ...
file handling9/3/2008
  Q: I want to make a programming for reading existed file then multiplying each data and write each of ...
  A: the simplest way to do this would be to: a. read one line from the file into a string b. from the ...
file handling9/2/2008
  Q: I want to make a programming for reading existed file then multiplying each data and write each of ...
  A: that is pretty simple: // open input, output files ifstream fin( in_file ) ; ofstream fout( ...
c++ file handling9/1/2008
  Q: I want to make a programming for reading existed file then multiplying each data and write each of ...
  A: to set the format to fixed-point and precision to (say) 6 decimal digits after the decimal point: ...
difference of <> and " "8/31/2008
  Q: sir, when im includeing a header file for eg #include<stdio.h> and also as #include"stdio.h" both ...
  A: for a #include <header_name> new-line searches a sequence of implementation-defined places for a ...
c++ file handling8/31/2008
  Q: I want to make a programming for reading existed file then multiplying each data and write each of ...
  A: if you are familiar with the STL part of C++, #include <iostream> #include <fstream> #include ...
doubt regaring wParam8/28/2008
  Q: My question iis, is there any specific value for the middle click(that is the scroling button in b/w ...
  A: if the middle mouse button goes down on the client area of a window, a WM_MBUTTONDOWN message is ...
spech technology in c++8/25/2008
  Q: sir, i am currently interested in doing a project on speech technology through c++ implementation ...
  A: what aspect of speech technology are you doing a project on? is it speech recognition, speech ...
Creating class objects by reading text file8/22/2008
  Q: I want to create a class object by reading the text file. For example, if my text file has sentence ...
  A: > where could call of the void save(..) and base* create_from_stream(..) lie? anywhere, really. if ...
Creating class objects by reading text file8/21/2008
  Q: I want to create a class object by reading the text file. For example, if my text file has sentence ...
  A: in a simple scenario, you could do something like this: #include <iostream> #include <fstream> ...
different variables stored where8/21/2008
  Q: where are these variables stored in memory and in which part RAM/ROM? 1)static 2)global 3)const ...
  A: where a variable is stored and the life time of the variable is determined my the storage duration ...
Read file into 2D array8/19/2008
  Q: I do not know what is wrong with the following code. I am trying to read data into a 2D array. The ...
  A: ok, let's start from the top in your code: > #include <iostream.h> > #include <fstream.h> I suppose ...
macros in c++8/18/2008
  Q: Vijayan what is the purpose of macros in c++? and how can i use a macro from another file/program? ...
  A: > what is the purpose of macros in c++? macros are a type-unsafe feature of the C preprocessor and ...
book8/18/2008
  Q: Please tell me the best book for ASP.NET and c#. Thanks, RAVI
  A: i am not an expert on C# or ASP.NET. i have some familiarity with C# and you might find C# ...
regarding c and c++ standard library8/16/2008
  Q: I am doing my MSc project to find out code complexity for some companies in both C an C++. And also ...
  A: the gnu compilers and libraries for both C and C++ are perhaps the most widely used by programmers. ...
cstrings and strings in c++8/15/2008
  Q: Vijayan i want to convert from cstring to strings and vice versa how can i do this? thanks
  A: c strings are simply arrays of char terminated by a null char. eg. char cstr[] = "hello" ; cstr is ...
Object stream8/14/2008
  Q: . We r implementing one network protcol in c++ , we are using java code as reference.. In java we ...
  A: to perform network i/o, you could use the socket++ library. it has the same interface as that of the ...
bank account program in C8/13/2008
  Q: Bank Account Problem 1. Create a bank account for a maximum of 10 persons. 2. Each account has ...
  A: 1. define a struct bank_account to hold the information about an account in one place. 2. create an ...

All Questions in This Category

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Top Expert on this page

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++09. i would not answer questions about gui and web programming.

Experience

over 15 years

Education/Credentials
post graduate engineer

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