48,986 Topics
| |
I'm attempting to write a function that scans a number from the user as a string and converts the string to an array of int type, then reverses the order of the array and puts zeroes where no scanned data exists (eg. program says "Enter a number up to 5 … | |
I have to take in a list of song names. When the user types in "mmm" then it stops, and it spits out the first and last song titles in a sorted list (alphabetically). This is what I came up with, and there's many an error, all seemingly bool errors. … | |
Hi friends, Can you pls tell me about "[B]explicit template instantiation[/B]". Suppose I have a simple program : 1. File : TClass.h [code] #ifndef CTCLASS_H #define CTCLASS_H template<class T> class CTClass { public: CTClass(T t1, T t2); ~CTClass(); T add(); private: T cm_T1; T cm_T2; }; template<class T> CTClass<T>::CTClass(T t1,T … | |
I am mingle with my CS labs to find the solution of how to find the maximum and minimum number of a entered numbers,can anyoe help me note "no function and array required to manipulate data in our lab"; | |
Hi, I am a newbie, can someone please clarify the difference between "\0" and '\0' and 0 as far as C++ is concerned?? Why can't they be used inter-changeably ?? | |
Could someone please give me an idea on how to do this? Suppose you have a group of people that needs to be transported on buses and vans. You can charter a bus only if you can fill it. Each bus holds 50 people. You must provide cans for the … | |
a) A large city has a number of colleges which offer a number of courses. A course may be offered by a number of colleges but the course fee varies between them. In order to help a user to make a decision, a program is needed to provide the following … | |
Okay i am trying to make a lock this is my code: [CODE]#include <iostream> using namespace std; int main () { char key [10]="abcd"; char answer[10]; cout<< "password:"; cin >> answer; if( key == answer) cout << "correct"; else cout << "incorrect"; return main(); }[/CODE] when ever i try to … | |
I wish to a write a program that creates an array of 100 random integers in the range for just argument sake from 1 to 200 and, then use a sequential search to search the array 100 times using randomly generated targets in the same range. Can anybody please help … | |
Help! I need to copy a char array initialized as a string from one array to another, using a function containing one line of code. Here is the code: [code]#include <iostream> using namespace std; void cpystr(char *instr, char *outstr); void cpystr(char *instr, char *outstr) { [COLOR=red]//Insert line of code here[/COLOR] … | |
Write a C++ program that will read user's full name into a C-string. User will enter first name followed by one or more spaces and then the last name. Also, obtain user's student ID also into a C-string. Pass the name and ID obtained along with another C-string to a … | |
I'm new to C++.. and killing my brain to find this 1 error and cannot figure it out!! I don't understand why square cannot equal true??? or false?? this is my 3rd program for my class to turn in!! Any help would be appreciated!! Eddy //This program allow the user … | |
Hi, i've been trying to create a program for implementing high/low pass filters on images. I get the data from a 24 bit .bmp file using the old file handling techniques. The file handling portion of my program works like a breeze, it is the arrays that are giving me … | |
i am new with c++ and as i was going through all the post i found a reserved word i.e. namespace. i am unable to know what do u mean by this and as i was trying to run the program there was a error telling "namespace name required". i … | |
Hi, I write program whitch read data from more industrial PC by SNMP. In program I use functions SnmpMgrOpen(agent, community, timeout, retries); SnmpMgrRequest(*session, requestType, &variableBindings,&errorStatus, &errorIndex) and SnmpMgrClose(*session). Problem is in read data. From first 3 pc data is readed correctly, but from next pc no. Function return no error, … | |
Hi i am writing a program to calculate the area of a shape using functions. I got the program to work fine when there was only one function and one shape however when i added the second one the program will still run both functions. That is even when i … | |
hi, i am reading the book "The c++ standard library -- a tutorial and reference"{N.M.Josuttis} in the beggining of the 6th chapter it says{in regard to container initialization}:: [CODE=c++] std::deque<int> c( (std::istream_iterator<int>(std::cin)), (std::istream_iterator<int>()) );[/CODE]{the weird indentation is on purpose} instead of:: [CODE=c++]std::deque<int> c(std::istream_iterator<int>(std::cin), std::istream_iterator<int>());[/CODE] because [QUOTE="N.M.Josuttis"]In this case, c declares … | |
>>>is there any limit/constraint on the maximum number of nodes that a linked list can have? >>>a linked list does not have to be implmented with a pointer. what else can be implementeation of linked lists? >>>how can a singly linked list be implemented so that insertion requires no test … | |
Just for notes, I'm using VisualStudio 2003. I'm working on a program that's supposed to make the Muller-Lyer illusion. I've got all of the coding done, but now when I try to run it all I get is a load of errors. First, it starts to compile the program and … | |
Hi, during the build of my code, i m getting the following error error LNK2001: unresolved external symbol __imp__QueryServiceStatusEx@20 i have included the library file advapi32.lib in project --> settings. but still the error is same. any pointers?? TIA | |
anybody here who could teach me how..or the function on printing an output file in linked list.. | |
Hello, I know that "break" is used to end a loop, but how does one exit a C++ console program, after the user enters a negative value, without using a loop? For example, I would like to do this: if (value == -1) { system("exit");} But the code above does … | |
[code] int main() { cout << "This Program was written by Nehal Shah\n" << endl; int num, total; cout << "Please enter an integer number:\t\t\t"; cin >> num; while ( num < 0 ) { cout << "\t********************************\n"; cout << "\t********** ERROR *************\n"; cout << "\t********************************\n"; cout << " --------------------------------------\n"; … | |
How do do you close an external application after previously running it using shell execute in Borland C++ builderr? | |
What im wondering, is because im making a little text adventure game, and i have to write lots of descriptive writing and i would like it all to stay together in a paragraph. But the only way of getting that on output that i know of is to just have … | |
ok, so I have read some tutorials on file streams, but i am still confused. I have made a program that edits a .txt (inputted by user) file, but my goal is to search an entire file for a string, and every time the string its found, I want it … | |
Hey everyone, I have an assignment to work on and it's a bit confusing. Here's the problem: [quote]Using dynamic arrays, implement a polynomial calss with polynomial additions, subtraction, and multiplication. Discussion: A variable in a polynomial does nothing but act as a placeholder for the coefficients. Hence, the only interesting … | |
How do you incorperate sound files into a C++ program? | |
#include <iostream> #include <cmath> using namespace std; int main() { // Declare constants and variables const double ACCURACY = 0.00001; double x, factorial, ex_approx, ex_funct, curr_term; int terms, i; // Read value of x for exp(x) calculation cout << "Enter the value of x you wish to use for exp(x) … | |
hello all, I'm new to c++ and am currently reading the book "C++ how to program" by Deitel. I'm working on exercise 7.15 from his book and am just stuck with the problem. Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is … |
The End.