49,761 Topics

Member Avatar for
Member Avatar for Milton Neal

I'm re-kindling some of my C++ theory and was working through a C++ SringBuilder class I found on the net. I understand it all except the 2 operator methods. (See listing below). Can anyone explain what these operator methods are for and how and why you would impliment them. class …

Member Avatar for rstralberg
0
125
Member Avatar for nicholas.buckley.14

I have to write a program that accepts data for a class and then ouputs it in the main. so far i have this. #include<iostream> #include<string> #include<fstream> using namespace std; ifstream infile; class animal { string species; string family; string phylum; string desc; static int count; public: bool readIN(const string …

Member Avatar for rstralberg
0
314
Member Avatar for Vish0203

hi everyone! I'm working on project which Generates certificates for different students. The interface takes the input of Name, College, Secured position and generates the certificate... but I want to generate all the certificates at once. So, to avoid overlapping of the file names, i want to generate different file …

Member Avatar for Vish0203
0
130
Member Avatar for darkeclipse8

---------------------------------------------TSet.h------------------------------------------------------ #include <iostream> using namespace std; template <class V> class TSet { public: TSet(); TSet(int size); ~TSet(); void add(V new_item); void remove(V item_to_remove); int num_of_items(); bool isFull(); bool is_item_in_set(V item); friend bool operator==(const TSet<V>& left, const TSet<V>& right); friend bool operator!=(const TSet<V>& left, const TSet<V>& right); friend ostream& operator<<(ostream& outs,const …

0
155
Member Avatar for izabella.pearson

I can not figure out the problem with my program. I am extremely knew at this. The error I get is at the last ' } ' of the program it says "Error expected declaration before '}' token" please help? This is my code #include <iostream> //Header Files #include <fstream> …

Member Avatar for Lucaci Andrew
0
138
Member Avatar for kw83028

Hello, this is my first post here so please let me know if I'm doing something wrong. I have a linked list project that I'm having a little trouble with. I was given LinkedList.cpp (main) and that can't be changed. I had to use a completed program that we did …

Member Avatar for kw83028
0
418
Member Avatar for McCrockett

Hello. I'm currently taking a computer science course and I'm doing a little research paper about C++. I honestly don't know C++ too well yet. But I have a few questions that I would like to ask and feel free to post your opinions. I hope this is the right …

Member Avatar for L7Sqr
0
134
Member Avatar for Growl

# MERSENNE PRIMES # ## There is an integer n. Find primes that is < than n (p < n) and they can be expressed in the form 2^k-1. ## Hey! I'm done with connecting parts together - all works fine! But I need to replace (pow(2,p)-1) because my professor …

Member Avatar for NathanOliver
0
108
Member Avatar for Sasquadge

Hey guys I'm having some trouble figuring out what is going on I'd appreciate if anyone could help here is the instructions. 5. The SalesEmployee constructor a. uses a_commission and a_sales arguments to initialize the commission and sales member variables respectively b. calls the SalariedEmployee constructor and passes to it …

Member Avatar for Sasquadge
0
178
Member Avatar for shorty001
Member Avatar for ps- india
-1
2K
Member Avatar for vicky30312

I am making a guessing game for my programming class, and i have it all working correctly, except that when you run the program the number it guesses is always lower. Are my math equations wrong? what do i need to change? There are no error messages. //P //Project 8.4. …

Member Avatar for vicky30312
0
162
Member Avatar for daino

I've managed to generate a Pkg-Config makefile using MSYS in the configure process and when I've tried to build it I've got the below errors. I'm thinking there might be a basked meaning for these kinds of errors. Any clues as to what it is. This is for pkg-config 0.27.1 …

Member Avatar for Lucaci Andrew
0
268
Member Avatar for thammalatha

Hi, Iam using ReadDirectoryChangesW function in winAPI to know the access details of a file in a directory.the code is as follows... HANDLE h,hDir; ifstream myfile1; ofstream myfile2; char *buff="",temp[256]=""; int i,length; Entry *head=NULL,*tail=NULL,*e=new Entry(); hDir=CreateFile((LPCSTR)"C:\\sample\\example.txt",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); h=FindFirstChangeNotification((LPCTSTR)"C:\\sample",FALSE,FILE_NOTIFY_CHANGE_LAST_WRITE); BOOL b=ReadDirectoryChangesW(hDir,buff,1024,FALSE,FILE_NOTIFY_CHANGE_LAST_WRITE,NULL,NULL,NULL); DWORD d=GetLastError(); but i got the error 998 memory access violation.plz …

Member Avatar for Lucaci Andrew
0
247
Member Avatar for schutzk21

Hello everyone. I have a few questions about this project that I need to code. And If you can please show me how the code should look I would very much appreciate it. Write a program that can sort integers, decimals, and characters from ascending and descending orders. The program …

Member Avatar for Lucaci Andrew
0
198
Member Avatar for GamerDJX

I need help with a program that I am working on. Basically the program right now takes a decimal number and converts it into whichever base I choose. What I need it to do is accept other inputs initially (binary, hexa, octal) and convert between whichever I choose. Can anyone …

Member Avatar for vijayan121
0
219
Member Avatar for thammalatha

#include <iostream> #include <windows.h> #include <fstream> #include <string> using namespace std; class Entry { public: char name[50]; int id; float sal; bool b; Entry *next; void clear(Entry *head,Entry *tail) { while(head!=NULL) { head=tail->next; delete tail; tail=head; } } }; int main () { ifstream myfile1; ofstream myfile2; char *buff="",temp[256]=""; int …

Member Avatar for thammalatha
0
141
Member Avatar for CodyM

Trying to make my function that takes in an array and arrayLength and outputs a linked list equivalent to the array.Any help would be greatly appreciated! Node* array2List(int A[], int n) { Node* p; Node* q; q = NULL; for(int i = 0;i<n;i++) { p = new Node; p->val = …

Member Avatar for NathanOliver
0
105
Member Avatar for pigrabbit87

I's running this on visual c++ and it runs without error. However, when I tried to run this on Linux, it kept giving me this "segmentation fault" message without any output. There is no pointer and is a quite simple program so can anyone please tell me what is wrong?? …

Member Avatar for pigrabbit87
0
3K
Member Avatar for Darth Vader

Hi, I wonder if this namespace is possiblet to use. However I cant find ::Messaging in System::Windows ? I do use this namespace in Silverlight to mention. Is there a assembly etc to add to be able to use this? System::Windows::Messaging

0
100
Member Avatar for Carc369

I'm trying to think of a way to compare a string of multiple words and take each individual word to a dictionary. I have a binary search already coded but it's just breaking the string apart I'm having trouble with. I have to use C-Style Strings (character arrays). For instance …

Member Avatar for Carc369
0
162
Member Avatar for mc3330418

I'm trying to find the highest score from 6 scores taken from a text file. The code I have works, but it looks so inefficient. There should be a way to do it with a for loop, for (int i = 0; i < count; i++) if (max > score) …

Member Avatar for mc3330418
0
147
Member Avatar for daniel.moore.5099940

I need some serious assistence with finding the solution to this problem, it has plagued me for some time now and im just not getting the big picture. I need to move the elements in a 2d array according to the user input, but the way i have figured out …

Member Avatar for Labdabeta
0
392
Member Avatar for lifuno

#include <iostream> #include <string> #include <fstream> using namespace std; //Listans struktur typedef struct lista{ string namn; string ort; lista *next; }; int main(){ int antal = 0,antalspara=0,antallika=0,antalPerson=0; int langd; string namn, ort; bool bfinns; ifstream fil; string filnamn; //För första listan lista *afirst, *alast, *node, *itt; afirst = NULL; alast …

Member Avatar for deceptikon
0
96
Member Avatar for Alexkid

Hi there, I have an array of unsigned chars that hold hex values, I’m interested in values [5] and [6] of the array. Say [5] = 0x5b = 0101 1011 and [6] = 0x7b = 0111 1011 I'm trying to get all of [5] and the first half of [6], …

Member Avatar for L7Sqr
0
191
Member Avatar for MugANDGlass

can anyone help me? i got problem count the monthly installment. //class class vehicle { public: char model[20], color[20], brand[20]; float price, deposit, rate, monthly_installment, newprice; int term; public: void calculate_installment(); }; class car:public vehicle { private: float installment, newprice; public: void calculate_installment(); }; //main program #include <iostream> #include <string.h> …

Member Avatar for DeanMSands3
0
172
Member Avatar for vicky30312

I cant figure out why my second switch stament is not working. Can you please help? I am still new at this still. // Project 8.4. Guesses the number the user enters between 1-100. #include <iostream> #include <ctime> using namespace std; char H,L,Y,N; int UsersNum, YesNo, HighLow, Re_Use; int n …

Member Avatar for vicky30312
0
148
Member Avatar for Memo143

#include<iostream.h> #include<conio.h> #include <stdlib.h> int main() { int *ptr[5]; int a[] = {1,2,3,4,5}; //declaring and integer array char b[] = {'a','b','c','d','e'}; //declaring and Character array *ptr=a; //assign values of integer array to integer pointer array for(int i=0;i<5;i++) //by looping, Print values of array a, pointing to pointer { cout<<"A["<< i+1 …

Member Avatar for Schol-R-LEA
0
125
Member Avatar for anukavi

*Hi, Greetings to u all ... I am new to this website as well as in C++. I got a question in c++. I need to remove decimal point from amount (declared as CString) Eg. Amt is 145.76 I need the final output as 014576 and same to be stored …

Member Avatar for anukavi
0
99
Member Avatar for soujanya.bhat.184

I am not able to understand the concept of virtual functions. When a member function of base class is redefined in derived class,the redefined function can be used to get desired output. Then why there is a need to use virtual functions? For instance, the following two codes produce the …

Member Avatar for Agni
1
197
Member Avatar for sujskiez

I need help with this program where i need to create a book record program where the program can view, update, add and delete books. Now this is the main menu: MAIN MENU 0. Exit 1. Search for a book 2. List books of a category 3. List books in …

Member Avatar for arghasen
0
245

The End.