49,755 Topics
![]() | |
/* the thing is that i need to check if a given number (n) is a palindrome. i also used limits.h to identify if the number is is exceeding the limit. i came up with this beut it's no good. any ideas? */ #include <iostream> #include <stdlib.h> #include <limits.h> #include … | |
Hello all, So here is my problem: I have 2 functions that one uses the other's calculations and result: int functionA(int a, int b) { int x = a+b; return x; } int functionB(int a, int b, int c) { int xx = x(a,b); int f = xx * c; … | |
I need to read a text file, parse file, and check occurence of words without leading or trailing punctuations. this is what i have so far, std::ifstream f("textfile.txt"); std::istream_iterator<std::string> eof; std::multiset<std::string> words( std::istream_iterator<std::string>(f) , eof); for( std::multiset<std::string>::iterator i = words.begin(); i!=words.end(); i = words.upper_bound(*i) ) std::cout << *i<< ": " … | |
Hello, I wanted to ask. If I define `typedef float mymat3[3];` and then I have a function: void myfunc(float *One_mat_, .... and inside function I do: mymat3 * One_mat=(mymat3 *)One_mat_; while(i<numPoints) { One_mat[i][0] = (One_mat_[++c1]); Does this mean , that I am copying One_mat_ (which I am casting it as … | |
I can't figure out how to add a loop to allow the user only three attempts to enter in a valid password. Any hlp would be appreciated it . #include <iostream> // cin and cout #include <cstring> // for string #include <conio.h> // for getch #include <cctype> // conversion using … | |
Hello I want to solve it randomly reads the lines. I found a source code, but it will crash the program. This is source code: DWORD cFindEvent::GetRandomPosition() { //--------------------------------------------------------------------------------------- FILE * garew = fopen (MobCoords,"r"); //--------------------------------------------------------------------------------------- char temp[1024]; int i = 0; int j = 0; int licz = rand() … | |
My code is not reading my data file well. The code is supposed to read fractions from decending order, but it does not work half way through. please help! #include <iostream> #include <fstream> using namespace std; void read_data(int nums[],int den[],int size); void clean(int Cnum[],int nums[],int den[],int Cden[],int size); void low(int … | |
i wanna ahelp please hospital project i have made aclass room composed of 4(class bed) i wana to initalization all rooms ids and all beds id once time not every time i run the programmme example room 1 ---->bed1,bed2,bed3 // bed class <<--- class bed{ int id; bool empty; public: … | |
//write void write() { setlocale(LC_ALL, "en_US.UTF-8"); cout <<""; } template <typename A, typename ...B> void write(string argHead, B... argTail) { setlocale(LC_ALL, "en_US.UTF-8"); if (blnBlink==true) { CONSOLE_SCREEN_BUFFER_INFO csbi; GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); string a; a=argHead; TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes); COORD Position; Position.X=csbi.dwCursorPosition.X+strlen(a.c_str()); Position.Y=csbi.dwCursorPosition.Y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position); } else cout << argHead; write(argTail...); } template <typename A, … | |
am doing my project phase 1 its about hospital : i have made a person class--patient inherite from it i wanna afunction to----add,alter,delete patient---------------- in text file the output 1--> add patient 2-->alter patient data 3-->delete a patient class person{ int id; string fname; string lname; string gender; int age; … | |
As a lecturer, you are required to prepare an analysis of your student performance based on their marks. Therefore, you have to develop a software system that capable of doing so by evaluating their marks. The computer system that you will be developed must able to find the minimum, maximum … | |
Plz help me tell me how we can convert the C program in C++ I working on OCX(Active X controls) plzzzzzzzzzzz...............reply | |
Here is the website for the assignment: http://www.docdroid.net/6ap6/inheritance5.pdf.html Note: The ones highlighted in blue are the ones I completed, and the ones highlighted in yellow are the ones I need help with. Here is the website for the first header file (point.h): http://ideone.com/6bAeqv Here is the website for the first … | |
Hello, I am working on an event driven library and am having one minor problem. Basically I have two ways to get what I want done. Method 1: Smart pointers and factory functions #include <iostream> #include <vector> #include <memory> using namespace std; class Object { public: virtual int getInt(){return 0;} … | |
When would you open and close files within a function instead of in the main program? ________________________________________ | |
so im trying to write a website in c++ using the treefrog framework. it all went fine following this tutorial http://www.treefrogframework.org/documents/tutorial and i got the page up, but i cant figure out what files i need to edit to actually edit the webpage itself. can anyone help? | |
write a function named, smallestValue, that accepts five integers and return the smallest integer accepted.( just write a function) | |
Hello, Is there any utility which can generate sequence diagram from existing C++ source code? Thanx in advanced. Amitendra Mukherjee | |
A palindrome is a word or sentence that reads the same forward as it does backward. Write C++ code that read string consist of 6 characters only and check if the string palindrome word or NOT. | |
please help i would like to Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. | |
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 “***”. ![]() |
The End.