I have a Polymorphic class and some child classes, of which I need to make multiple instances of, using a list container. I've set the key type to be a unique pointer of the polymorphic class, and the values of each element pointing to a New Child instance, like so:
The only problem is that when I try to push_back a new element, I get a compiler error, saying "No instance of overloaded function".Should I try and create a pointer object on it's own and push back that object as an element, it will work fine:
I am getting the error on the implementation of my class name. The error is coming from my parkingControl.cpp 'ParkingControl parkingControlMenu;'. I have used this implementation fine before, but once I added a new main it stopped working. Below is my code.
I am trying to write a program that reads in an XML file, parses it and prints out information about each tag. I am getting the following errors when trying to build the program:
Parser.cpp:24:1: error: 'Parser' does not name a type Parser::getXMLData() { ^ Parser.cpp:120:1: error: 'Parser' does not name a type Parser:rocessXMLData(
When declare and assign an instance of a user-defined struct in a function. And the struct (theStruct) is not declared in the same header file as the function (theFunction). Like this:
files: "A.h": declares the struct in a class (theClass) "A.cpp": implements the struct "B.h": declares the function "B.cpp": implements the function, error here
I think making the instance (inst) a reference might solve this. But the instance is assigned to a return value from a function (returnFunc). Like:
void theFunction() { ... theClass::theStruct inst = returnFunc(...); //returnFunc() returns an instance of theStruct //the error is at 'inst' ... }
I'm trying to learn recursion, and I'm using a simple array to experiment with it, but I have a couple of annoying errors that I don't understand why they're there. Here's the code:
Code: #include <cstdlib> #include <iostream> using namespace std; int largest(const int arr[], int lowerIndex, int upperIndex) { int max;
[code]....
Now try to print the array backwards:
//Use a recursive algorithm to find the largest element in arr: int largest(arr[], lowerIndex, upperIndex);//error: expected an expression return 0; }
I am trying to use a class Student and declare it as a list type. I can pushback but without changing the List.h or Node.h how can I print the data in list2?
I program unix sokcet programming , and part of my code is ti open file from server and open it , but i surprised with this wierd error i dont have any reason for it ?
I've been writing the math functions for a 3d game and tried compiling it at about 30 functions in. I get this error related to my pointers to my structures. it affects almost everything in all my functions (as youll see by looking at how i do the math in the function below). The compiler gives me the error
"error: dereferencing pointer to incomplete type"
on all my struct Type4D pointers but referencing the values in my struct TypeMatrix4X4 using pointers seems to work fine i think (it doesn't seem to complian explicitly about it. so here is the important code...
I am having trouble with this program I get the error dereferencing pointer to incomplete type in the populate function I am using BloodShed's Dev C++ compiler v4.9.9.2 I copied this program out of a book because I was having a problem with a linked list in a similar program. I think there is a problem with the compiler not supporting these types of pointer's in a function.
So I query out data from multiple tables and I put it as anonymous type. But since I need to get the remove function going, my datagridview has to get datasource from a bindinglist, not just a list. What could I do from this situation? I already checked: [URL] but intellisense doesn't pick up the .ToBindingList() function for my query.
do { printf("Edit the entry's cellphone number:"); scanf("%s", addressbook[4][num]); length = strlen(addressbook[4][num]); //gets the length of the input (should be 10) //checks if the input is composed of 11 elements wherein the first 2 are 0 and 9 respectively for(i=0; i<11; i++){
I have part of a class that checks to make sure there is a fault that lasts for 60 seconds. The code below is written several times throughout the class for different subsystems dealing with overcurrent.
// Over Current if (UUV->getCTaps(MOTORCURRPOS_1) > 1.4*UUV->getcurrMode.getMotor().Peak) // The fault { if (motor1Timer == NULL) motor1Timer = time(&timer); else if ( time(&timer) - motor1Timer >= 60) motor1Over = true; } else motor1Timer = NULL;
The timing statement is okay because it works on all of the other fault checkers. It is the if statement that is causing the error I just do not know why.
Code: g++ --g -c ErrorH.cpp -o ErrorH.o ErrorH.cpp: In static member function "static ErrorH& ErrorH::Instance()": ErrorH.cpp:9: error: invalid initialization of non-const reference of type "ErrorH&" from a temporary of type "ErrorH" make: *** [ErrorH.o] Error 1
This code works on Windows, how can I get it to work on Linux?
I am an IT student currently learning linked list. I have a problem with my code here. After I call addFront() my list doesn't change when I display it. How do I somewhat change/fill my list without changing the function type? I know it works on pointers still messed up with linked list.
I am writing a simple program to suck in a txt file then pump it into sql.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Data.OleDb; using System.Data.SqlClient;
[Code] ......
How I can get past this error and get the data into sql? I read a couple articles on .tag but not sure I understand what to do.
I am trying to write a generic linked list in c, but for some reason i keep getting errors saying "incompatible pointer type. This is the code and erros: