49,761 Topics

Member Avatar for
Member Avatar for Moaid

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 …

Member Avatar for mike_2000_17
0
246
Member Avatar for Tlotleng

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);. …

Member Avatar for Neuman
0
280
Member Avatar for DS9596

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 …

Member Avatar for deceptikon
-2
161
Member Avatar for Shibbir Khan

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)) …

Member Avatar for Moschops
0
204
Member Avatar for shahera.arafat

**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); …

Member Avatar for shahera.arafat
0
203
Member Avatar for ndowens

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); …

Member Avatar for egidijus.aranauskas
0
4K
Member Avatar for aluhnev

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 …

Member Avatar for aluhnev
0
375
Member Avatar for Jeroen Mathon

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 …

Member Avatar for Jeroen Mathon
0
177
Member Avatar for skiboy209

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 …

Member Avatar for JasonHippy
0
354
Member Avatar for Silfro

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 …

Member Avatar for uonsin
0
254
Member Avatar for asdsadddsadsd

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 = …

Member Avatar for uonsin
0
444
Member Avatar for aluhnev

//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 …

Member Avatar for tinstaafl
0
474
Member Avatar for kadyjizz

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

Member Avatar for dhirendra_1
-1
85
Member Avatar for lewashby

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() { …

Member Avatar for NathanOliver
0
308
Member Avatar for Tosho

I have to create a Data Base on Chemical Elements and their Abbrevations. Whic saves Data in its Files

Member Avatar for NathanOliver
0
67
Member Avatar for francototti

#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 …

Member Avatar for abdul04
0
187
Member Avatar for lewashby

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?

Member Avatar for lewashby
0
322
Member Avatar for rose_2

i will start studying programming with C++ prog. language .. which programs should I use ?? please I need some help

Member Avatar for JasonHippy
0
229
Member Avatar for aluhnev

#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> …

Member Avatar for JasonHippy
0
328
Member Avatar for Zaprzap

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 …

Member Avatar for NathanOliver
0
252
Member Avatar for nitin1

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 …

Member Avatar for Moschops
0
161
Member Avatar for Elixir42

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 …

Member Avatar for Elixir42
0
249
Member Avatar for yaldoo

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 : …

Member Avatar for sepp2k
0
4K
Member Avatar for Vincent_5

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 …

Member Avatar for rubberman
0
218
Member Avatar for bops

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 …

Member Avatar for muhammad raees
0
27K
Member Avatar for khalil je
Member Avatar for aluhnev

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) • …

Member Avatar for jBat
0
198
Member Avatar for lewashby

#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 …

Member Avatar for rubberman
0
210
Member Avatar for jBat

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 …

Member Avatar for jBat
0
803
Member Avatar for nitin1

#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 …

Member Avatar for rubberman
0
199

The End.