49,761 Topics
| |
I'm new to this site, and I heard that I can get help from here with learning programming. I am having trouble with sentence strings. If someone inputs a sentence followed by just a single character, I want the program to only write the sentence until that character is first … | |
Ok, i have this program It determines if the number entered is a prime or not. I did that, posted it, and now i need to do this: Determine and print the prime numbers between a user-specified lower bound and user-specified upper bound. Read all through my text and browsed … | |
Im trying to take all prime numbers 1 to 100 and outputting them to a file but its not working here is my code so far. [code] #include <iostream> #include <fstream> using namespace std; bool isPrime(int numcheck); void write_prime(int prime, ofstream &outfile); int main() { ofstream primefile("prime.txt"); for (int ntc … | |
Hi, Does anyone here have any experience of using libtiff in c++? I have been trying to do some simple image processing using it and I don't seem to be able to write images. I can make files that have roughly the right size, but they're not correct as they … | |
Hey all, I was wondering if you could help me out with parts of my C++ code that I'm writing. Overview goes something like this: im making a finance recording system. So i have 5 files. one file is to save all the incomes (like a paycheck). another file is … | |
I am working on homework, and been doing this assignment with absolutely no luck, i am in need of major help. This is the assignment. Using an array, initialize all elements in the array to 1. Starting with array subscript 2, every time an array element is found whose value … | |
This function should create an array of size 50 containing randomly generated letters within the range [1, 25]. The program should write the randomly generated array to an output file named by the user. Determine the maximum and minimum values and the indices of their first occurrence and also the … | |
hey .. i write this code .. but i have errors .. i think because i didn't use the enum in the right way?! .. can anyone tell my how to correct it .. i got these errors :( .. : 'stone' : redefinition; different basic types see declaration of … | |
hello everyone.. please help me with my program. Please help me solve a program that could accept more than 10 digits. Thanks | |
Hello everyone, I am beginner with Microsoft Visual Studio. I was doing my project and somehow I pressed some shortcut and enabled some kind of "indent notifiers" or whatever the purpose of this thing is. Now I have no clue what I pressed, but it is really irritating, and makes … | |
hello guys: i awais ahmad has a simple problem with the two dimensional array. that is how to get two values in one column of the array | |
this program should add 2 integers in the range of 20 digits, but only 10 digits are allowed, else the sum would be incorrect. can anyone plz show me what's wrong with my codes? Here's what i got so far.... [CODE]#include <cstdlib> #include <iostream> using namespace std; int main(int argc, … | |
[B]So here is what I am trying to accomplish. I have been trying and trying for a few hours to figure out how to do this. Write a program that displays a menu with the following choices to the user. A - Find the largest # with a known quantity … | |
I am working on a project that inputs stock information from files, then outputs the information when the customer is called upon. I am doing pretty good, but am stuck. This is what I have. [CODE] for (int k = 0; k < namevector.size(); k++){ //namevector is a vector of … | |
NOW I HAVE SHOWED SOME EFFORT PLEASE HELP ME NOW, HERE IT IS WHAT I WOULD LIKE TO HAVE AND WHAT I HAVE DONE WITH THE CODE. Hi, i have to programm this in c++ can anyone please help me and solve the code i have written Material Weight (kg … | |
Hello, I am trying to "peek" the next character to see if it is a character. If the word exceeds the max linelength it should be written in the next line with the count starting from zero again. for example: if the max line length is 10, The max length … | |
// David Barkman // CSIS 123 - Murtha // Program 13 // #include <string> #include <iostream> #include <fstream> using namespace std; void displayMenu(); void addRecord(); void searchRecords(); string userName; int main() { // Prompt fior the user name cout << "Please enter your name to begin: "; // Input the … | |
Hi, I created File Open Dialog (custom) using GetOpenFileName with hook file. (Files are attached). I am opening a dialog in a main window of application that has a command button. Clicking of this commad button opens File Open dialog. However, after selecting a file and clicking either "Open" or … | |
[CODE=c++] const int MAX=200; char line[MAX]; char s2[MAX]; inf.getline(line,MAX); for(;;) { for(int i=0; i < MAX ; i++) { if (line[i]=='\0') break; else if ( line[i] != ' ') strcat(s2, line[i]); } } [/code] hello, I have a question. I'm trying to have the loop process words in the array … | |
I get the program to run but no matter what choice i make it comes up with -99 to exit... [code=cplusplus] #include <iostream> using namespace std; const int A_QUANTITY = 10; const int B_SENTINEL = -99; int main () { bool again = true; char choice; int biggest = 0; … | |
If I were to ask the user to enter the number of employee. Could I put that user entered number into an array? If so how? for example [CODE] int num; cout << "enter number of employees: " ; cin >> num; array[num]; [/CODE] this code doesn't actually work because … | |
I have a project where I need to reformat a plain text file. for example, Hello nice to meet you. Glad to be here. will be reformatted to the following: Hello nice to meet you. Glad to be here. how can i write a code to remove the newline character … | |
I'm working on a program that reads in from a file a list of customers and puts them in a vector. I did that. Next, there is a file for each customer that I put in this vector. I need to open the file, and "assign the data to a … | |
I am writing a program and one of my classes is called Employee the private variables for Employee class are string firstName; string lastName; I have a child class called StaffEmployee and for its private variables I would like to use int employeeID; I want to create an object in … | |
I am going through and rechecking my work on a project and was hoping someone might see if I am on the right track. First off the project is as stated: A baseball team manager wants a report showing her players' batting statistics. A batting average is computed as hits … | |
I have a person datafile of many entries. Persons will be stored in a linked list and each of the person amongst other things will have a linked list of items belonging to them. The object of the program is to use a quicksort algorithm to print out entries of … | |
Hi im trying to print out rows and columns using ascai characters to resemble pixels. I am trying to get the user to input the dn values for the array and then use these values to then print out the appropriate character. Im really stuck now and have been at … | |
Good Morning, This is a bit of a double question thread. First what i have done is written a basic stop watch program, it runs through the loops and iterates the time on screen. My first question is this: is there some way to leave the program listening for user … | |
| |
Hi all, Just have a curiosity about multiple inheritance. I have defined two classes, each of which returns a string to described an object of that class. I have also made another class which inherits from both of the above classes. I want to define a function in the derived … |
The End.