49,767 Topics
![]() | |
The program works perfectly. But in order for an individual to succeed in computer science, he or she must fiddle around with the program, and come up with other algorithms, such as converting a pre existing one, even it it is more or less efficient. Again the program works perfectly. … | |
I'm taking an Intro to C++ course and I'm having some difficultly with a lab I'm working on. I don't have any code yet. I've been working on my design file but don't know which direction to go in to solve the problem. I want to put the dataSheet into … | |
I wrote a short program to factor numbers, and it works in most cases. The problem I am getting is that when I use a very large number I get "Floating point exception: 8." I am assuming that I am trying to divide by 0 on line 43 or 46, … | |
Hello, I am having some difficulties getting my program to write the contents of an object to a file. First off, I am not sure if I should be writing the contents of the the object (e1, e2, e3) to the file or if I should be writing the contents … | |
I'm trying to build a tree from a file and it keeps blowing up on me. It doesn't even give an error but it shuts down when I try to run it. I'm not sure what is wrong. I think I have something wrong with my root but I'm really … | |
Sorry! The problems are all solved and every error is removed.. Sorry guys! Modes: Please delete this thread. CJ | |
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 … | |
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 … | |
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 … | |
---------------------------------------------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 … | |
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> … | |
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 … | |
![]() | 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 … |
# 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 … | |
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 … | |
anyone please guide me to create a exe program in visual C++ 2005. Thank you | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
#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 … | |
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 = … | |
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?? … | |
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 | |
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 … | |
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) … | |
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 … | |
#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 … | |
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], … |
The End.