49,761 Topics
| |
This is the problem: Write a class EncryptableString that is derived from the STL string class. The Encryptable string class adds a member function void encrypt( ) that encrypts the string contained in the object by replacing each letter with its successor in the ASCII ordering. For example, the string … | |
What is the best way to read a text file and print to console, then grab that string and convert string to a const char? | |
Instead of entering text to console, I want to use the text from a text file and use this function and method to do a concordance count of words and how many times they appear in the text file. check line 137 #include "stdafx.h" #include<stdio.h> #include<stdlib.h> #include<string.h> #include<conio.h> #include<ctype.h> #include … | |
a C++ program that reads in two partially filled arrays. One array contains student IDs (with int type) and the other contains GPAs (with double type). The program will sort the two arrays according to the student ID and print out the results? | |
I have been working on this code (school assignment) for a few days now. It seems to be almost finished, but I am not sure what's going on. When I run it in an online complier, it displays correctly, which is supposed to look something like this "12345" "1234500000" However, … | |
#ifndef BASE_H #define BASE_H class Base { public: int m_nValue; Base(int nValue=0) : m_nValue(nValue) { std::cout << "Base" << std::endl; } }; #endif #ifndef DERIVED_H #define DERIVED_H #include "Base.h" class Derived: public Base { public: double m_dValue; Derived(double dValue=0.0) : m_dValue(dValue) { std::cout << "derived se" << std::endl; } friend … | |
the function is a std::function<void(string a) write; ok.... it's void.... but why the error about it??? what means these error? | |
i understand that the macro is a code that is changed before compile it. so i did these macro with these code: #define (events2((y),(x))) (class events3 : public ( y ) { events3(); ~events3(); }(x) ; ) //#define (events2((y),(x))) (class events3 : public ( y ) { events3(); }(x) ; … | |
Write a program that accepts two integers from the user, if any of the integers follow the other, print “ a follow b” otherwise print “***”. | |
How can I create an array of pointer using **P and point it to NULL? Let's say I have coded as below . struct s { float a ; char x ; } ; s **p ; p = new ( s * [10] ) ; Now I want to … | |
You have to implement a file system that should have the following specifications. On the execution of your code your console should display the following options to the user. 1. Create a new file. 2. List & view existing files. 3. Copy file from windows (*.txt). 4. Copy file to … | |
My application requires a dialog box and a parent window, from the window proc of the parent window I'm trying to draw on the dialog box. How might I do this? Thank you for reading :) | |
The title of this is slightly misleading but its also specific to what I'm asking. I've got a project which uses Ogre and CEGUI. I'm only trying to get CEGUI up and running. I don't know that much about compilers and IDE's but I can program and I also read … | |
Hi , I need to implement efficient search algoritham for comma separated list of MSISDN's that needs to be loaded in memory (left side of '|') character. Followed by the comma separated series of MSISDN's that needs to be searched in the above huge list(millions)(right side of '|' character). Example: … | |
I have to create a program that uses a class Pstring derived from the STL class. The only error I am getting says that I have one unresolved external. How do I fix this? Here is my code: #include <string> class Pstring : public std::string { public: Pstring(const std::string &text) … | |
This is the assignment: Assuming that a year has 365 days, write a class named DayOfYear that takes an integer representing a day of the year and translates it to a string consisting of the month followed by day of the month. For example, Day 2 would be January 2 … | |
see these class: class test { public: void Created(){}; test() { Created(); } }; now we can create objects from it. ok. but can i overloading the scope-resolution ('::') for the object accept and change the Created() function? | |
Am having problems converting from if-else statements to switch statements and vice-versa | |
Hi group, I am searching for a complete word list A thru Z. No definitations, parts of speech, or origins of the words. Just a comprehensive, unabrigded listing. Any suggestions? | |
hello, I am having problem with selection sort, I am trying to sort the students name alphabetically.I compile it and it shows me whole bunch of errors in VS. I dont think it has do to do with my display all students function, I think it has more to do … | |
Here is a function to print my binary search node tree, void printtree(struct node *tree) { if (tree!=NULL) { printtree(tree->left); printf("%s %d\n",tree->word, tree->lineNumber); printtree(tree->right); } } How would I save what I print to a text file??????? | |
Unhandled exception at 0x561330d9 (msvcr100d.dll) in main.exe: 0xC0000005: Access violation reading location 0x440b4bd8. i try my best to debug it, but don't have clue on it. **fft.h** #include <math.h> #include <stdio.h> #include <stddef.h> #include <stdlib.h> #define NR_END 1 #define FREE_ARG char* #define M_PI 3.14159265358979323846264338327 static double sqrarg; #define SQR(a) ((sqrarg=(a)) … | |
Hello, I am having a particularly nasty case of "What is the syntax?" while working on an event driven library. Basically this is what I want: class Object {// private: public: virtual bool onEvent(Event e)=0;//all objects have to react to events Object operator|(const Object &o) { // I want to … | |
I've been trying to fix a problem with getline() and cin.getline().Here's a example I've made and it still has the problem: [TEX]" No matching function to 'getline(std::istream&, char[100])' "[/TEX] Here's the code: [CODE] #include <iostream> #include <windows.h> #include <string> using namespace std; int main() { char name[100]; cout << "\nEnter … | |
this programme should calculate users amount of watt consumed based on their appliances and the approximate number of hours is used in a day, week or month. the basic requirements are; give user option of selecting predefined home appliances or entering their own and corresponding watts per appliance,list home appliances … | |
Hi, I have faced a problem that I have a vector in my class which I would like to initialize using constructor initialization list with some thing like this std::vector<double>({1,4,5}) which is only allowed in c++11 which is not what I am looking for. I could only intialize it with … | |
Hi everyone. Well, I'm overwhelmed with the amount of C++ books out there and own a few now. I'm specifically looking for a C++ Reference book which lists C++ STL libraries and functions like the orielly C++ pocket references on C++ or STL. Orielly's C++ in a Nutlshell looks pretty … | |
this is the question : Write C++ a program that reads a person's age in years and print his/her age group. See the table below. Age------------Group name 1 year---------Childhood 2-3 years------Infancy 4-5 years------Preschool-Age 6–12 years-----School-Age 13–17 years----Adolescence 18–29 years----Young-Adulthood 30–39 years----Thirties 40–64 years----Middle-Age 56–48 years----Aged 85 years ------Very-Old You HAVE … | |
when we create the window, we can choose some styles. but i see 2 problems: - how can i hide the border?(i have seen the msdn styles, but theres no const for that) - how can i change the styles after create the window? | |
Consider this piece of code class Example { }; class ExampleAccessor { public: struct ConstructionFlag { ConstructionFlag() { } ~ConstructionFlag() { } }; explicit ExampleAccessor(Example&) { } ExampleAccessor(Example&, const ConstructionFlag&) { } }; int main() { ExampleAccessor accessor(ExampleAccessor::ConstructionFlag()); } Which is the minimal example of something I found in our … |
The End.