49,761 Topics
| |
Given an integer n, print the following shapes using asterisks and spaces. For example, for n = 5 the following shapes are printed Input: 5 Output: * * * * * * * * * * * * * * * | |
Hello, I was recently looking through some of my code and found what I believe to be a memory leak. It is in a function that appends two strings and I am not sure how to resolve it. Here is the function: const char *strapp(const char *str,const char *s) { … | |
I can't work around these errors. Can someone help me out? Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Error 3 error C2238: unexpected token(s) preceding ';' Error 1 error C2143: syntax error : missing ';' before '<' Code: #pragma once #ifndef … | |
Hi I've written this small program to demonstrate the Diffie–Hellman key exchange algorithm. The desired output from the program is for most runs correct. However occasionally there are some discrepancies in output of the shared secret keys values in that they don't match, when they should. I've found that certain … | |
Hi, i have a home work to do and is about Array-based Lists and Array-based Queues but i have no idea what goes on with my class since they have put me a higher level that i was supposed to be. Does anyone know any sites to send the hw … | |
| /* Made in code::blocks 12.11 -randomly generated terrain mirrored to be equal for bought players - - */ #include <iostream> #include <windows.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <fstream> #include <cstring> #include <string> #include <cstdlib> #include <ctime> #include <sstream> #include <cctype> using namespace std; //Public functions char printMap(char terraniValue); … |
Here are 6 files I've been beating my head against the floor for about 20 hours now. I know I am sooooo close, but I just can't seem to find much information about overloading operators in a derived class to perform arithmetic operations on objects created in the base class. … | |
Creat a text file that contains student number ( 9-digit number ) , year ( one of the four years: Senior denoted by SE, Junior denoted by JU, Sophomore denoted by SO or Freshman denoted by FR ) and GPA ( a floating point number greater than 0.0 ) . … | |
Hi)I've been using Codeblocks for a long time;since I configured the Toolchain executables shortly after installing I had no problems with compiler;but now when I try to compile a program, codeblocks responds with a statements about wrong compiler path;when I try to run a program it responds with "Target uses … | |
i want to write a c++ code that due the structure of file space allocation,Simulates file system with 2*n array.Each column represents a sector,The first row is for storing files And second row holds the address of the next sector (Number of columns).and With each click on keyboard Create a … | |
This program is for a car rental agency. Your program will have to compute the total cost of a rental. This agency has two types of cars, and the rates per day are as follows: All cars come with a basic insurance that covers damage to third Driver above 25 … | |
Hi, this program is a high-low guessing game that generates a random number and the user has 6 guesses to win their bet. When I run my code the "random number" is always the same. Any help is greatly appreciated. #include <iostream> #include <iomanip> #include <ctime> /* to access the … | |
This seemingly small code which swapps 2 numbers is giving me a headache..help!! C++ + am wondering why would one need to swapp the numbers in real life? trickery? magic | |
i made a project using visual studio and opencv ,it worked fine. however later i thought of adding GUI. i googled and found abput QT.some how i managed to include libraries and build paths,when i use **C fucntions of opencv** the program works fine but when i use ***c++ features … | |
i am trying to vendor specifc attribute from this WMI class MSStorageDriver_FailurePredictData(HDD SMART information). Here is the used code : IEnumWbemClassObject* pEnumerator = NULL; hres = pSvc->ExecQuery( L"WQL", L"SELECT * FROM MSStorageDriver_FailurePredictData", WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); IWbemClassObject *pclsObj = NULL; ULONG uReturn = 0; while (pEnumerator) { HRESULT hr … | |
Hello, I am currently writing a program that estimates Pi values using three different formulas pictured here: http://i.imgur.com/LkSdzXm.png . This is my program so far: #include<iostream> #include<cmath> #include<iomanip> using namespace std; int main() { double leibniz = 0.0; // pi value calculated from Leibniz double counter = 0.0; // starting … | |
I want this structure variable as well as all the structure elements to be used in multiple source(.cpp) files. I did like this and getting did like this and getting following errors. I am using vs2010. Please help me i am a newbie. Error 2 error LNK2001: unresolved external symbol … | |
I'm beginner with c++ and want some help Create Class CSalary with private member variables string m_strProfession double m_dSalary Constructors:Default,Copy,Explicit Functions: 1/string GetProf(void),double GetSalary(void) 2/SetProf(const string val),SetSalary(const double val) 3/Output(ostream&) and Input(istram&) 4/Operators:<<,>>,=,==,<,double operator*(const CSalary&obj) Create Class CCalcCorr with private member variables: vector<CSalary>m_vCity1//data for city 1 vector<CSalary>m_vCity2//data for city 2 … | |
The aim is to create a gdb function that changes current path to the upper level i.e `C:\Windows` to `C:\` I tried to strip away characters while the buffer array != '' Here is what I tried: void gdbCommand(){ char buffer[MAXCHAR]; strncpy(buffer,path,sizeof(buffer)); char result[MAXCHAR]; for(int i = 0; i < … | |
| Hello How can we know which GCC version is compatiable with a given Python version ? Regards |
Write a C++ application that asks the user to enter 10 numbers. The program then stores those numbers in an Array. The program should display the Mean , Median, and Mode. Mean is the average of the 10 numbers. Median is the average of the 5th and the 6th numbers. … | |
hi I have a project due this Monday to make an address book. need some help with that.I have some code with me but it is not working. please help me if you can. i have attached a copy of the same and given description below. program description: develop a … | |
using namespace std; int numCheck(int x); int main () { const double LAWYER = 0.10, PERSONAL_ASSISTANT = 0.03, AGENT = 0.07, TRAINER = 0.05; double athleteBeginSalary(0.0), lawyerSalary(0.0), personalAssistantSalary(0.0), agentSalary(0.0), trainerSalary(0.0), professionalTotalSalary(0.0), athleteEndSalary(0.0); int numLawyer, numPersonalAssistant, numAgent, numTrainer, x(1), y(0); string firstName[8], lastName[8]; // The number of the Professional hired: Lawyer, … | |
after the 1st iteration the toss is 100 and then the iteration increases toss to 200 and then 300. Why is this happening i want toss to be made only hundred times. PLease help me. #include <iostream> using namespace std; #include <cstdlib> #include<ctime> int toss(void); int main(void) { srand(time(0)); int … | |
i have this for my requirement assignment: Write a search function int get_index(const float astm[?][?], const int size) to find the array index from a given size. can someone give me some hint on how to di it pleass? | |
Hello programmers! I was working on a program that reads a sequential file with bank accounts. The file has three sets of data per line: the account #, the account holder's name, and balance. Then, I made a program to print the file- and it printed the last line of … | |
I am having trouble reading uint ARRAYS properties from WMI objects. I can read and process STRING properties from WMI objects. | |
Simplified code snippet produces assertion string out of bounds error if I do not uncomment the if statement in main. using namespace std; size_t find_next_of(string & src, size_t pos) { //size_t tmppos; //if (pos != string::npos) { return src.find_first_of('a', pos); //} //return string::npos; } int main( void ) { string … | |
Hello Im quite Confused right now. I am trying to insert a Node in between nodes and it is not being displayed. Please Help. #include <iostream> #include <conio.h> #include <cctype> using namespace std; struct Node { int DATA; Node * Next; }; Node * head = NULL; void Display(); void … |
The End.