49,757 Topics

Member Avatar for
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
247
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
442
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
274
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
186
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
26K
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
199
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
790
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
Member Avatar for lewashby

The book I'm using continues to give me code and fails to explain the syntax. I got to a chapter on operator overloading and it gave me some code but didn't actually explain any of the code. I having trouble understanding the Rectangle operator+ line and that methods contents. Why …

Member Avatar for lewashby
0
191
Member Avatar for Elixir42

Hi 'Wise & Wonderful Daniwebbers', Why do I keep loosing my project settings when I add a new project to an existing solution? I have to go to every project, in the solution and re-configure each project's: * Include Directories; * Library Directories; * Linker Settings; etc., Which of the …

0
145
Member Avatar for preet4fun

[CODE]#include <iostream> #include <iomanip> #include <string> #include <cctype> #include <cstring> using namespace std; const int NUMROWS = 14; const int NUMSEATS = 7; //enum seatsType {A,B,C,D,E,F}; void initPlane(char plane[NUMROWS][NUMSEATS]) { int x,y; //strcpy(plane[2], "Row 1"); plane[0][0] = ' '; plane[0][1] = 'A'; plane[0][2] = 'B'; plane[0][3] = 'C'; plane[0][4] = …

Member Avatar for Gozo Anne
0
9K
Member Avatar for Đăng

my teacher asked me "Why c++/c## support operator overloading and java don't?" I have an answer for Java. anything I read, just said about how to write, define or something else. No answer for "why" someone can give me a document which I need or the answer. thanks for reading …

Member Avatar for mike_2000_17
0
424
Member Avatar for DS9596

Is this a good pseudocode and can you help me write this, I am kind of new to programming. if (choice > 0 && choice < 4) //choice is between 0 and 4 { cout << "Enter the distance: \n"; //displays the distance cin >> distance; //prints the distance if …

Member Avatar for rubberman
-1
442
Member Avatar for Gunjan_1

what is accessor and mutator ?? and what is overloading of accessor and mutator?? Plz explain...

Member Avatar for NathanOliver
0
60

The End.