49,761 Topics
| |
hello i download qt sdk and started the qt creator and tried to do a simple empty project but it says The program has unexpectedly finished on the error list and i tried many examples but same thing happens , im using windows 7 x64 homepremium and mingw as a … | |
Like the title says; Why would you want to make class objects (instances of a class) instead of built in types parameters of a function and in C . E.g. Why do this: class Person { public: void SetAge(Person &Age); instead of this: class Person { public: void SetAge(int iAge);. … | |
Rich Software Inc. has hired you for an internship position to create new payroll software for their 5 employees. Your goal is to create a program that reads the data.txt file with their 5 salaries. After that, the user can select from a 4 choice menu that handles the user’s … | |
I have this function and everything works until a and b both equal 1. When that happens the carry bit is going to 2 when its supposed to be only 0 or 1. Is my algorithm wrong for the carry bit carry_bits |= ((a & mask) & (b & mask)) … | |
**this is the code and it keeps giving me a red line under (z=v2*v1),,please help me finding the mistake :( :( thanks ^_^ #pragma once using std::cout; using std::cin; using std::ostream; using std::istream; class vector{ public: friend ostream& operator<< (ostream&,vector&); friend istream& operator>> (istream&,vector&); friend vector operator*(vector &,vector &); vector(void); … | |
I am trying to learn C++. I wrote a little calculator using class to see if I can do it and give some practice. The following is the code: [CODE]#include <iostream> using namespace std; class Calculator { float a, b; public: float add(float, float); float subtract(float, float); float multiply(float, float); … | |
Hi,i used this example for practicing,supposed to be easy one,but,abit confusing. Can you help to solve and point to mistakes i've done. Postman Pat became bored one night at the postal sorting office and to break the monotony of the nightshift, he carried out the following experiment with a row … | |
I can't see to wrap my head arround the meaning of this error. Its becouse im converting integer functions to character functions. src/dataio.cpp: In function ‘char* getName(char)’: src/dataio.cpp:118:17: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] readUser(uid); ^ src/dataio.cpp:60:6: note: initializing argument 1 of ‘void readUser(char*)’ void readUser(char* uid) ///Reads … | |
Hello, I have been learning SDL through a set of tutorials [here](http://lazyfoo.net/tutorials/SDL/index.php). The program was able to bring up the image for each key that I had added. After adding code to omptimize the images the window pops up but shows no image and if I press a key it … | |
| Hi I have a problem with converting a struct.. I got 2 different structs but they have the "same" data. Struct1: struct sStruct1 { BYTE Base1; WORD Base2; float Base3; } Struc2: struct sStruct2 { BYTE* Base1; WORD* Base2; float* Base3; } Now I the problem: I have data inside … |
| Hi how can i arrange these numbers in acending and descending order? #include <iostream.h> #include <conio.h> main(){ int n1=0; int n2=0; int n3=0; int n4=0; int n5=0; int n6=0; int n7=0; int n8=0; int n9=0; int n10=0; int sum=0; float ave = 0.0; int highest; int smallest; float mean = … |
//HI,need help to extract info from text file and display. //Here is my text file called Report.txt 01 09 2014 john 3.4 12.5 9.5 02 09 2014 freddy 3.4 12.5 9.5 03 09 2014 conor 3.4 12.5 9.5 04 09 2014 mike 3.4 12.5 9.5 05 09 2014 john 3.4 … | |
Write a C++ program that accepts tens names and consequently remove the following expressions from each name: ‘in,’ ‘on,’ ‘el,’ ‘am’ and ‘er’. Ultimately display all the names after their specified modifications. Hint: Use the erase and find string functions | |
In the following program what is `ifstream`? It looks like it might be a Class name making `file_in` an object of that class passing `filename` as an argument but this particular book hasn't touched OOP yet so I wasn't sure. #include <iostream> #include <fstream> using namespace std; int main() { … | |
I have to create a Data Base on Chemical Elements and their Abbrevations. Whic saves Data in its Files | |
#include <conio.h> #include <stdio.h> #include <string.h> #include <fstream.h> #include <iostream.h> #include <stdlib.h> #include <iomanip.h> class Movie{ public: char name[40]; char dir[40]; char writer[40]; char release[6]; char genre[40]; char cast[80]; char budget[10]; char grossing[10]; char country[30]; char lang[30]; char rating[5]; }; int compare(char *, char *); void input(char *); void list(char … | |
One of my C++ books was showing the line `cin.getline(arg, arg)` and later showing `getline(cin, arg)`. Why is the second one not object.function and yet have the object as one of the arguments? What's the difference? | |
i will start studying programming with C++ prog. language .. which programs should I use ?? please I need some help | |
#include "stdafx.h" #include<iostream> #include<fstream> #include<string> #include<vector> using namespace std; struct DATE{ int day; int month; int year; }; struct onDutyRecords{ string name; double sunshine; double rainfall; double midTemp; DATE date; }; onDutyRecords person; int ShowMenu(void); void ListDaysOnDutyOfMet(vector <onDutyRecords> &); void ListAllTheWetDays(vector <onDutyRecords> &); void ListDaysOnDutyOfMet(vector <onDutyRecords> &); void ListAllTheSunnyDays(vector <onDutyRecords> … | |
I have been working through the Accelerated C++ book. In the fifth chapter I am beginning to construct my own programs without the aid of step by step instructions from the book. There is an exercise that requests for me to write a program that produces a permuted index. The … | |
For my project, I need to learn multithreading in C++. I have read 4-5 articles on Google, and have searched for more but they all are more or less similar. I want to learn it in depth. Can you provide me some links/source/anything for learning mutilthreading in C++? I am … | |
Hi Answerers, **Background:** I just figured out how to solve my unresolved external symbols by just dragging the project files from explorer (contained in exe's directory) and plonking them in the dll project, under thier own filter! **Original Situation:** I was getting 'unresolved external symbols' errors because I was #include-ing … | |
Hello All! I am having trouble with my C++ code. The problem is that my code isn't giving me the correct logic outputs, Also, my teacher said to MUST MAKE the output look like this : P and Q : T P or Q : T P --> Q : … | |
Currently im creating a simple phone directory. I am having a problem when searching the vector. It only lets me search for the exact key in the directory when I need to to search for strings that are close to the name. For example when I search "car" it will … | |
Hi again everyone, Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im … | |
Hi everyone. I have a bit confusion about vector. here is my 2 structs <global>and in the main have vector declared. file name is"report.txt" Have file with meteo readings,like • the meteorologist’s name on duty that day (a string of up to 12 characters) • hours of sunshine (double) • … | |
#include <iostream> class Book { public: Book(char* char*); private: char* title; // dynamic pointer to char array char* author; // dynamic pointer to char array public: Book& Book::operator=(const Book& b) { if(this != &p) // make sure it's not the same object { delete [] author; // delete author memory … | |
I'm not understanding why i'm able to read from the file but i can't write to it. The fstream is open in both modes. Once the program finishes i haven't changed the content of the file. Thank you in advance. #include <fstream> #include <string> #include <iostream> int main() { std::string … | |
#include <iostream> using namespace std; class Time { private: int hours; // 0 to 23 int minutes; // 0 to 59 public: // required constructors Time(){ hours = 0; minutes = 0; } Time(int h, int m){ hours = h; minutes = m; } // method to display time void … |
The End.