48,986 Topics
| |
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> … | |
Literally, I have been asked this question ""The Fibonacci sequence is 0, 1, 1, 2, 3, 5, 8, 13, … ; the first two terms are 0 and 1, and each term thereafter is the sum of the two preceding terms – i.e., Fib[n] = Fib[n – 1] + Fib[n … | |
Everything was running fine, then I made a simple change. Like adding a class or two and bang!!! C2995. Can you spot where I have obviously gone blind and cannot see the error. I have header gaurds throughout the solution, so I dont understand why this is happening. Here are … | |
I recently learn about the polymorphism and I don't know what is the purpose to use this feature. From http://www.cplusplus.com/doc/tutorial/polymorphism/ , it uses the child class rather than the parent class. I thought most of the time we inherit and we only use the parent class to access the child. … | |
Hi, I do have doubt regading use of delete p . In most of the scenarios we call delete inside the destructor if we would have called something int *p = new int (10); but as per below code snippet (original code of delete p) it already invoke the destructor … | |
Can anyone please explain to me how to compute DCT? I'm finding it hard to understand it. ![2D-DCT](/attachments/large/3/2D-DCT.png "2D-DCT") ![dct1](/attachments/small/3/dct1.png "align-right") I attached the formulas the Discrete Cosine Transform (DCT) and it's Inverse-DCT. | |
Roots of quadratic equcation #include<iostream.h> #include<conio.h> #include<math.h> void main() { float a,b,c,disc,root1,root2; cout<<"enter a"<<endl; cin>>a; cout<<"enter b"<<endl; cin>>b; cout<<"enter c"<<endl; cin>>c; disc=(b*b)-(4*a*c); root1=(-b+sqrt(disc))/(2*a); root2=(-b-sqrt(disc))/(2*a); cout<<"root1"<<root1<<endl; cout<<"root2"<<root2<<endl; getch(); } any question or assignment ask to me!guys | |
Alright so my problem is I am getting an error that says undefined reference to all of my functions related to DoubleLinked, DoubleLinked<string> dict, dict.add, etc. If anyone knows why that would be great. Thank you. Oh and if i add () to DoubleLinked<string> dict then i just have undefined … |
The End.