51,592 Topics
![]() | |
1. What happens when you add an element to a vector that is already at capacity? Does std::vector have a "capacity"? 2. In C++ and OOP in general, what do you call a design where a Person class inherits from Head, Arm, Body, Leg classes instead of the other way … | |
These are the errors that i am getting J:Project 2Binary.cpp: In constructor `binary::binary()': J:Project 2Binary.cpp:37: error: no match for 'operator=' in '((binary*)this)->binary::head_ptr = 0' J:Project 2Binary.cpp:6: note: candidates are: nodeType& nodeType::operator=(const nodeType&) J:Project 2Binary.cpp: In copy constructor `binary::binary(const binary&)': J:Project 2Binary.cpp:43: error: invalid initialization of reference of type 'nodeType*&' from … | |
I have develop a functor array without class but fail to write a functor relate to class. Here is the code without class int returnOne (void) { int a = 0; a++; return 10; } int returnTwo (void) { int a = 0; a++; return 20; } typedef int (*functor2) … | |
![]() | 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.Xml; using System.IO; namespace Enrolement { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { /* This part of my code imports the … ![]() |
Hi there I have a C++ code and I need to write it in C to do the simulation. Can anyone help? Thank you so much. and for random.hpp I will replace that with random.c (a random number generator in c) #include <cmath> #include <cstdlib> #include <fstream> #include <iostream> #include … | |
i installed codeblocks on windows8 but when i compile one of c program error message mingw32-g++.exe: Internal error: Aborted (program collect2) the same problem happened on devc either what will l do | |
How many bytes of memory is allocated when you declare: double* p1[10]; | |
I am trying to get each elemnt of a text file with 13 integers in one line, each seperated by a space, into each slot of an array, any idea how to do this? | |
In the following program I declared "long" for a, but still getting incorrect negative output after the 1860th term (all are supposed to be positive). What is the cause? int main() { for (int i=1; i<=2000; i++) { long a=i*i*i/2-3*i*i/2+3*i-1; cout << setw(3) << i << "\t" << setw(8) << … | |
I've written bucket sort, to read a list of numbers from a file, sort them, then write the sorted list to a new file. My program runs through the process just as it should, but whenever a bucket is completely sorted, it doesn't save the changes in the bucket. My … | |
Hi, ive been trying to print out a dictionary item with its List but im so confused about it. Basically I created a dictionary and I managed to add an Item to the dictionary(as a Key) and List of something (as value) Dictionary<String, List<string>> dic = new Dictionary<String, List<string>>(); public … | |
Hello everyone I am trying to make a app. witch uses windows that pop-up if a button is pressed. the problem is, i don't know how to make more than one window. Can anyone tell me how to do that? I am using Microsoft Visual Studio 2010 Express, in a … | |
Hello, I'm building opencv library with cmake for mingw to be used with qt and i've been able to generate the makefilelist. But when i type **mingw32-make** at the command prompt i get error when it's 44% built. error says: *Cannot export _ZN12_GLOBAL__N_13R)p3aLLEv: symbol not found Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol … | |
Hi, I have a problem compiling the "pjproject.sln", and I have the following error appearing: "fatal error LNK1104: cannot open file 'dsound.lib'" Build log was saved at "file://c:\Users\SLF101\Desktop\PJ Project\pjproject-2.0.1\pjmedia\build\output\pjmedia_test-i386-Win32-vc8-Debug\BuildLog.htm". Could anyone help me solve that problem? It seems like it does not want to open the "dsound.lib" file everywhere. That … | |
when we press the button ,then appear like this private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { } after that if we want to appear the caracter like "A" , after press the button , how is the program for that?? thank you before | |
Greetings As the titles says I wanna know what are versions of C++ other than Standard C++ and what are the differents between those version if any! Second question what is contained in the .exe file I'm using Microsoft compiler "Visual Studio 2010 IDE"? Is it contains the assembly instructions? … | |
Hi again! So, I have an object that gets appended to a linked list now. Now I need to have all of that item's data output in a formatted manner - something similar to this: CD Artist CD Title CD Length Track Name Track Length Arist name here Title here … | |
Basically, I'm getting an error when I try to append a CD object to my linked list. What error? This one: > First-chance exception at 0x550257aa (msvcr100d.dll) in Programming 3 Course Project.exe: 0xC0000005: Access violation reading location 0xfeeefee2. > Unhandled exception at 0x550257aa (msvcr100d.dll) in Programming 3 Course Project.exe: 0xC0000005: … | |
I have a class called Control. All other "controls" inherit from this class. Some controls need a default constructor so that I can assign or construct them later. The classes look like: class Control { private: //All Members Here.. void Swap(Control &C); public: Control(DWORD dwExStyle, std::string Class, std::string Title, ....); … | |
I need to read this into a arrays. 123455 45 67 87 69 98 3456787 67 98 34 54 67 456778 87 76 89 76 34 344568 65 78 76 45 98 56789 98 76 45 34 54 Here is the code I have void getGrades(double exam[], int studentId[]) { … | |
I don't what's wrong with this simple piece of code I wrote. It keeps crashing. Output Screenshots: http://i.imgur.com/8xwet8m.png http://i.imgur.com/FXBa8YM.png #include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; int main() { char *strg; cin>>strg; cout << "Hello world!"<< strg<<endl; getch(); return 0; } | |
i have a problem regarding classes . i have been given two files vector.h and set.h the vector.h file is : #ifndef VECTOR_H #define VECTOR_H class vector{ private: int *array; int max_size; //max size of vector int elements; //total element in vector public: //initializes everything to zero/null DefaultVector(); //initializes the … | |
hey guys does any one has idea how to write a program which calculates all the characters in a sentence | |
![]() | i added libmysql.dll as resource to my project ID_LIBMYSQL RT_RCDATA "LIBMYSQL.DLL" Image view :: http://s18.postimage.org/bcpf2s9jt/Untitled.png now when i try to find it using findresource function , i get error code : 1812 mean resource not found HMODULE hMod = GetModuleHandle(_T("libmysql.dll")); HRSRC hRes = FindResource (NULL, "ID_LIBMYSQL", RT_RCDATA); // RT_RCDATA application … ![]() |
I need to multiply 2 matrices together using threads to computer each element. Ive been working on it myself but Im stuck at this point and Im getting an error. Here is the code I have. Can someone help in explaining what is wrong here or how to correct it? … | |
Hi I have declared BYTE myKey[10]; and on executing the value stored in myKey is 0x9100 i need to do string compare this value with user defined value (9100) how can i do the comparison? i converted to int int tempkey = (int)myKey[i]; //(have put it in loop based on … | |
I was looking at the possible solution to synchronise a bounded buffer ( like queue) using condition variables and think that we probably need two condition variables to correctly implement the synchronisation, one condition varaible will have a queue where the consumer thread(s) will be waiting to see if the … | |
Why do I need a static class member? What are the advantages and disadvantages of it? Is there any way that I can have non-static member fuction without doing anything outside of the class (such as passing an instance)? class Control { private: HMENU ID; HWND Handle, Parent; std::string Class, … | |
This might be (in fact I can probably say it is) a really dumb question but it's been doing my head in since I've been looking at it. First off, I've been looking at C++ for a short time and it's confusing to me more than what Java ever was. … | |
I need to modify an object in a QVector. I'm the `[]` operator to point to the object, which is overloaded with a constant and a non-constant version. The problem I'm having is that I don't know how to specify the non-const version, so I get compile errors telling me … | |
I'm designing a embedded system and we have to oftenly report system fault in different code module. So I decided to create a source file to keep the error log and I'm building a struct for that. So that, every module reporting the error log and store in a data … | |
Okay, so I am trying to figure out how to refernce an external file for a username and password This is a little game i am trying to make and i need help with this part When prompted, the user types in their username and password to register i want … | |
I have an XML file that is in this format: <root> Test string <Signature> WvZUJAJ/3QNqzQvwne2vvy7U5Pck8ZZ5UTa6pIwR7GE+PoGi6A1kyw==</Signature> </root> I was able to produce the SHA256 and produced a string by using the following: string CalculateSHA256(const string& input) { SHA256 hash; string digest; StringSource _(input, true, new HashFilter(hash, new HexEncoder (new StringSink(digest)))); return … | |
I am having a hard time trying to run this excercise. This works great up until the direction to declare the member functions Once declaring romanType member functions protected: ___________________ class romanType class romanType { protected: void storeRomanInput(char RomanNum[25]); void convertToDecimal(char storage[25]); void printAsRoman(); void printAsDecimal(); }; I am unable … | |
I'm looking for some C++ code or direction in writing some to close an app if it detects another instance running. Our little update utility writes a log file, which I'm thinking of using as the clue. I was thinking that before the second instance attempts to write to the … | |
When I try to find all subsets of a set using the following code, the iterator vit in the inner for loop of the getPowerSet function misses out on one element certain times. Can anyone tell me why? #include<iostream> #include<vector> #include<set> using namespace std; vector< set<char> > getPowerSet(const set<char> &given); … | |
Hi, i've got a list with nodes with this structure: private: char namefield[30]; char tam[3]; char type[1]; }; i want to find and element with the find function from alghorithm class but i want to do it with the namefield property of the item, the find function has an item … | |
Hi! I am Working on TimeCode Slate Project (Working with: Arduino Uno Rev. 3), Now I working on the led display(8 digit 7 segment) code. I'm trying to modify this timecode display code from: "Dan Thompson - Timecode Based Stopwatch" http://danthompsonsblog.blogspot.co.il/2008/11/timecode-based-stopwatch.html to work with led display (Originally, the code from … | |
Hello..i tied a lot but i am not able to get the answer.. i am writing a program in which user input the array with space as delimiter eg- 4 3 5 2 3 so this value should be stored in array as a[0][0]=4 a[0][1]=3 a[0][2]=5 a[1][0]=2 a[1][1]=3 a[1][2]=0 please … | |
you will write a program to solve linear equations given in upper triangular form. There are N equations, and N unknowns. This is equavalent to the following matrix multiplication [A][X]=[B], where A is a square matrix (N by N), X and B are vectors with size N. Back Substitution: First, … | |
![]() | I was doing some exercise from C++ Primer and one of them required us to copy a set of value from array into a vector container. Then, we are suppose to remove all the even numbers from the vector container. Hoever, when I tried to display them out by incrementing … |
/*Calculator =========================program*/ /****************************************************************/ /*****************************************************************/ #include <iostream> #include <conio> #include <stdlib> /*****************************************************************/ /*****************************************************************/ float a[1000]; int top=0,i,r; char u; float input(); float d,p,q,w; void push(float x); void get(); void show(float arr[]); /***********************************************************************/ /***********************************************************************/ void main() { get(); getch();} /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ void get() { cout<<"\t\tPlease Enter number\t"; for(i=0;i<1;i++) { cin>>a[i];} show(a); } … | |
I am having an issue implementing the Breadth First Search, Im trying to find the shortest distance between the source city and the destination city. Here is what I have so far, Im stuck and dont know what to do about this issue. #include <iostream> #include <string> #include <fstream> #include … | |
#include<iostream.h> #include<conio.h> #include<string.h> #include<stdlib.h> #include"Student.cpp" void main() { clrscr(); int choice; student s; cout<<"MCA EXAM MANAGEMENT SYSTEM"<<endl<<endl <<"1. Login"<<endl <<"2. Register"<<endl; cin>>choice; switch(choice) { case 1 : clrscr(); cout<<"1. Student Login"<<endl <<"2. Teacher Login"<<endl; cin>>choice; if(choice==1) { s.studentLogin(); cout<<endl<<"back to main"; } else if(choice==2) { //Call to login function of … | |
Hello friends, my computer suddenly have a problem when I uninstall the program Tune Up Utilites 2013, after finish uninstall that program, and then I restart, suddenly theme of my computer back to classic mode and out notice as: Debug Assertion Failed ! ----------------------------------------------------------------------------------------------------------------- Program: C:\Program Files\Lenovo\Energy Management\Energy Management.exe File: … | |
#include <iostream.h> double box_area(int); double box_vol(int); void main() { int l,w,d; double a,v; cout<<"length : "; cin>>l; a=box_area(l); cout<<"area : "<<a; cout<<"width : "; cin>>w; a=box_area(w); cout<<"area : "<<a; cout<<"length : "; cin>>l; a=box_vol(l); cout<<"volume : "<<v; cout<<"width : "; cin>>w; a=box_vol(w); cout<<"volume : "<<v; cout<<"depth : "; cin>>d; a=box_vol(d); … | |
failing to install codeblocks on my machine , running windows 8. its saying the program cannot be verified.....anything to help please! | |
Hi guys/ and the minority of girls. This topic is for my teacher, who has asked me to find information of the following for himself. How can he interface a USB port to run a motor through C++? He is relatively good with computer systems himself, so why he does … | |
Hello everybody, This is parking program .I defined 4 task (keyboard,enter vehicle,exit vehicle,display) The program is compile but when I run it and press keys (E,S,F), it does not work. This program is written for linux. Can you help me? #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <stdlib.h> #include <pthread.h> … |
The End.