49,757 Topics
| |
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 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 … | |
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 … | |
[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] = … | |
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 … | |
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 … | |
what is accessor and mutator ?? and what is overloading of accessor and mutator?? Plz explain... |
The End.