39 Discussion / Question Topics
Remove Filter
|
|
Hello Daniweb Community, Lately we have been experiencing slow internet, now the thing is. In the house we have **12 devices** connected, then from the router it goes out to the bungalow which has around **5-7 devices**. The router we have in the house is a TP-Link Archer D50 and … |
|
Hello world! I am requiring some assistance with my C# program, where I am getting an error message for having a form where the user would enter in text into a text box. I am trying to detect if the user has pressed the Enter key, and on doing so … |
|
can someone explain me how this operator work? i just need some hit to clearify my confusion on this... thanks |
|
So I was asked to solve this question...however when i compile it, it doesn't work...could somebody tell me what's wrong and how to solve it (im guessing it's something to do with overloading since my lecturer was talking abt it just before this was given)? thanks a lot! #include <iostream> … |
|
I'm currently working on a project on VB.NET and I'm getting this error below. > Error 2 Overload resolution failed because no accessible 'New' is most specific for these arguments: 'Public Sub New(name As String, dataSourceValue As System.Collections.IEnumerable)': Not most specific. 'Public Sub New(name As String, dataSourceValue As System.Data.DataTable)': Not … |
|
I'm making a class for boolean expressions, a simpler version of bool. I need three operators, one for AND, one for OR and one for NOT. I can easily make **+** for OR, by overloading, but how can i declare **.** for AND and **'** for NOT? Can i even … |
|
I'm trying to make a program for my computer science class and it requires that I run output to the console as well as to a file. I'm looking for a way to intialize a string at the beginning of the program and pass the variable by reference to my … |
|
using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { Cassandra myObject = new Cassandra(); string a ="söt"; myObject.hejsan(a); System.Console.WriteLine(a); Console.ReadLine(); } } class Cassandra { public string hejsan(string value) { value +="Cassnadra"; return value; } } } how come this wont work? all i get is … |
|
|
#include <iostream> #include <cmath> #include <string> #include <cstdlib> #include <cstring> using namespace std; char Outputing(char shifted_letter); int found_match; int searching_alphabet; int main() { const char ORIGINAL_alphabet[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; //maybe const isn't necesery char alphabet[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; cout << "This program encrypts messages using Ceaser Cipher\n"; cout << "\n---------------------------------------------------------"; cout << "\n---------------------------------------------------------"; cout << "\nEnter … |
Hey everyone, I'm working on an assignment and I'm having some trouble figuring out how to implement two operators. The program creates and implements a class to represent the Stack ADT using a singly-linked list. There is a driver program to test my implementation. I have everything implemented (except the … |
|
Give then following Class declaration: class Employee { public string Name { get; set; } public int Age { get; set; } public override bool Equals(object obj) { Console.WriteLine("In Equals(Object)"); if (obj is Employee) if (this.Name == (obj as Employee).Name && this.Age == (obj as Employee).Age) return true; else return … |
|
I wrote two functions like that int absolute(int a) { return (a < 0) ? -a:a;} int absolute(int &a) { return (a = (a < 0) ? -a:a;} The two function have the same name and the same type, When I do like that: int main() { int a = … |
|
Hello, thought I'd ask before getting too deep into code to make sure I understand this properly. As described in the Gamma et. al. book the Visitor Pattern looks something like this: interface Visitor{ public void visitX(X x); public void visitY(Y y); public void visitZ(Z z); } interface Visited { … |
|
Hi there, I need to overload istream in this way: it needs to get string, then it has to parse this string and get number - can be longer than long long, and then save this number in another string, which I will give to class method. So far so … |
|
So I have a matrix class that must run on a unix/linux server. The main is a test file that is provided by the instructor. When I compile my code in visual studio it works fine except for test 8 because I can't figure out how to return a print … |
|
Hi folks, I am learning operator overloading concept in c++, wrote sample program to test overloading of unary operator '!' and '-'. Code will work if i use them as friend function but not for member function. Can anybody tell where am i going wrong in function bool operator!(const co_ordi … |
|
I am inserting all of the words in the dictionary into the unordered_set STL. For the life of me, I cannot figure out how to override the default hash function for the unordered_set. Can someone please point me in the right direction? I cannot figure out the syntax. Thank you … |
|
I am doing this assignment for my C++ class, and we have to instantiate 4 objects of the Student class, set the data members and then sort them according to the GPA variable. Ive whittled down the errors to just one, and I am stumped. Here is the error: error … |
|
I attempted to overload the == operator for one of my classes, I even copied a previous implementation of it, but now that I am using pointers it refuses to function properly here is the relevant code (there is a lot so I will provide more if need be) [CODE]#ifndef … |
|
|
Error C2662: 'Event::GetTime' : cannot convert 'this' pointer from 'const Event' to 'Event &'. This is my code: [CODE] #include <iostream> #include <queue> #ifndef Person_h #define Person_h #include "Person.h" #endif using namespace std; enum EventName { _SendMessageToUserInterface, _SetPNOld, _IntroduceInfection }; class Event{ int time; EventName name; Person person; public: Event(int … |
hi in my text book i have this problem. how to program this [ICODE] Define a class Quadratic_int that stores the coefficients of a quadratic polynomial in a dynamically allocated array of integers. Supply the "big three" memory management functions. Use this class to demonstrate (a) the difference between initialization … |
|
Hello forum. I cant figure out how to overload the '+' operator or maybe theres another error? Im posting from phone so excuse the slopyness. Thanks! [CODE]#include <iostream> #include <string.h> #include <ctype.h> using namespace std; class Ferma { public: static int nr_rate; static int nr_gaini; static int nr_porci; static int … |
|
|
Hey, so i've looked around online for a bit, and after finding similar, but not exact (as in it doesn't help me), i'm gonna post my problem here :P. I'm working on a class to handle Complex numbers. This is going to require a lot of operator overloads and the … |
Hey all, I'm writing a program that is an address book using an AVL Node structure (which was provided). I defined the [I]contact[/I] class as the ItemType of the data to be inserted in each node. Initially I encountered a Segmentation fault that occured during the assignment from the AVLClass … |
|
Hello, I have a problem which goes like this. I need to be able to design a simple class, which i have done, and it must represent any numeric value, which includes a decimal and negative value. So i need to overload the operators, because the '%' will make an … |
|
[CODE] #ifndef POLYNOMIAL_H #define POLYNOMIAL_H class Polynomial { public: Polynomial(); Polynomial(int ,int []); ~Polynomial(); const Polynomial operator+(Polynomial& p) const;// addition const Polynomial operator- (Polynomial& p ) const; // subtraction int getExponent(); //void setExponent(); void setCoefficient(); int getCoefficient(); void printPolynomial(); private: int exponent; // exponent int coefficient[ 10 ]; // coefficients … |
|
Hey, I keep getting this error, but from its description, I can't really tell how to fix it besides from what I've already tried, so any explanation would be great. The error I get is: clientrectlib.cpp(32) : error C2664: 'calcMinMaxValue' :cannot convert parameter 1 from 'overloaded-function' to 'float &'. The … |
|
Hi there, I'm new to the forum so please be kind :) I've created a class called node that has a standard constructor and an overload that uses an int as an argument. [code=c]class node { public: node(void); node(int inputs); ... };[/code] I can create an dynamic array of nodes … |
|
Hi experts! I have the following code which I use for dynamically creating objects in one module (executable or shared object (.so or .dll)) and be able to delete it from any other module while enforcing the call to the delete operator in the original module where the object was … |
|
I'm a little new to C++ templating, and I'm having trouble understanding this behaviour. Basically, I have a templated class, and I want to define the = operator between the class and the same class with any template parameter. The problem is that the overloaded version of the = operator … |
The End.