49,756 Topics
![]() | |
` #include "stdafx.h" #include <strsafe.h> #include "CHand.h" #include "resource.h" #include <Windows.h> #include <NuiApi.h> #include <NuiSensor.h> #include <string> #include <KinectInteraction.h> using namespace std; double x_cur,x_pre = 500; double y_cur,y_pre = 500; static const float g_JointThickness = 3.0f; static const float g_TrackedBoneThickness = 6.0f; static const float g_InferredBoneThickness = 1.0f; int APIENTRY … | |
Can u plz help why dis happens? I was told to write a cpp program to find the factorial of a number using go to | |
When I try to add the two array together it show me 0? ` #include <iostream> using namespace std; int add_arrays(int a[], int b[], int n); int main () { int numbers[5]={1,2,3,4,5}; int numb [5] = {6,7,8,9,10}; int total= add_arrays(numbers, numb, 5); cout << total << endl; } int add_arrays(int … | |
class Timerange{ public: Start_time start; End_time end; Timerange(string initstring){ //initstring xx:xx X, x:x //X->weekday string current=""; unsigned short mode=0; string timeA; string weekday; string timeB; for(unsigned short i = 0; i<initstring.length(); i++) { char c = initstring[i]; if (c==' '){ if (mode==0) timeA = current; else if (mode==1) weekday = … | |
#include <iostream> using namespace std; template<class T> class MyClass { private: T data; public: MyClass(T data) { this->data = data; } }; template<class T> bool operator< (const MyClass<T> & a, const MyClass<T> & b) { return (a.data < b.data); } int main() { MyClass<int> x(1); MyClass<int> y(2); if(x < y) … | |
Hi all. I want to take a set number of characters from a stringstream at a time and display them to the console as per my code below. Because of when the first blank space is reached the process terminates due to teh eofbit flag. Is there any way around … | |
I'm coding in visual studio. i have a problem in ConfigureSerialPort function. #include <windows.h> #include <stdio.h> #include <string.h> HANDLE hPort; BOOL WriteByte(BYTE bybyte) { DWORD iBytesWritten=0; DWORD iBytesToRead = 1; if(WriteFile(hPort,(LPCVOID) &bybyte,iBytesToRead,&iBytesWritten,NULL)==0) return FALSE; else return TRUE; } BOOL WriteString(const void *instring, int length) { int index; BYTE *inbyte = … | |
here is what i have to do: take 2 double array of lenght 10 call a and b and return ture if they are equal and flase otherwise; and write a function that take a and b and return and array which store the sum of correspond elemets. can someone … | |
I have been working on this program i am stuck on and need somw help i am placing the entry into from the main into a pointer array in the Stock class and then assigning the values to the Vehicle class. the thing i am having problems with is accessing … | |
I am trying to replace a bunch of substrings with another bunch of substrings. I've got that working great, but now my code is a mess. This is what I have : void parseChartData(string chartDataString){ if(!chartDataString.empty()){ chartData.clear(); //replaceAll("T44" , "4/4", chartDataString); string s = "*A"; string t = "[A]\n"; string::size_type … | |
I think I have the answer to this: First you get a self proclaimed expert who says it is absolutely wrong to ask for other people to write code for you (a la iamthewee) in this discussion here--> http://www.daniweb.com/software-development/cpp/threads/467572/question-a-car-class Then you find this self proclaimed expert begging for other people … ![]() | |
1-Write a program that prompts the user to input two positive integers (firstNum and secon Num) where the first number should be less than the second (validate your input). The program should output all the numbers and their squares between firstNum and secondNum (inclusive). 2-Write a C++ program which reads … | |
This is just a piece of code I've found over the Internet, and I'm trying to understand why the output is 3 1 1 2 1 1 2 3. Could anyone explain using a stack representation or something else, I am really stuck on this one. #include <iostream> using namespace … | |
| |
hi all i use gecode solver to solve my model ; but i get this error Access Violation when reading of the location 0x0000001c and i don't konw how to fix it here is my code : #include <gecode/driver.hh> #include <gecode/int.hh> #include <gecode/minimodel.hh> #include <iostream> #include <vector> using namespace Gecode; … | |
can i create 1 template that i use inside the class and not when i create the class object? | |
I want help in my code ,, the program should search for all words in a string For example , if the string is welcome to pointers world come and see the magic it should print welcome come . Any One can help me to find a way to solve … | |
iwant to implement an elevator simulator which will emulate the behavior of a system with two working elevators. | |
I have invented a new software which converts the given algorithm to source code. i invented a new language called algorithmic language to convert the algorithm. | |
i am having difficulty with the binary search function for some reason the comparisons are coming up much higher then they should be. heres my code from main comp = 0; for( index=0; index<Max_Tests; index++) { results = BinarySearch(list, test[index], comp); cout<< setw(5) << test[index] << setw(15); if( results == … | |
//Given the following program , what is the output for each of the numbered lines in main() #include <iostream> using namespace std; class X{ public: X() { cerr << "X()|";} X (const X&) { cerr << "X(const X&)|";} ~X() { cerr << "~X()|";} X &operator=(const X&) { cerr << "X::op=|"; … | |
cout << "Enter the filename " << endl; cin >> filename; inFile.open(filename); int length = 0; while (inFile) length++; IntStack stack(length); I keep getting an error and I have no idea why. Can someone explain what is going on with it? After I input the the filename, program terminates. My … | |
// Expect to print values of arr[0] to arr[4] #include <iostream> #include <vector> using namespace std; int main() { vector<int *> ptrList; int arr[] = { 0, 10, 20, 30, 40 }; int * ptrArr = arr; for( int i=0; i< 5; i++ ) { ptrList.push_back( ptrArr+i ); } vector<int … | |
cout << *static_cast<int*>(test); test is a void pointer pointed to an int variable. if i use: cout << *static_cast<char*>(test); i get just 1 character. so how can i print the value directly to string? if i use the string i get an memory error | |
Hey guys...so for my homework i have to do this...would it be possible if someone helped me with this? Not very familiar with maps and stuff like that yet...thx a lot! So here's the question: Suppose there is an application that allows users to enter a phone number to search … | |
Hi,I am having a hard time trying to do insertion sort on a singly link list containing single alphabets.I have spent hours doing this but still it wont work.Any help will be apprecited. Here is my code: # include <iostream> using namespace std; class node { public: char info; node … | |
The title says it all but I am curious if it's acceptable or even efficient for that matter. If others were to read my code or work on a project with me is this generally accepted among others or yourself if you work on an enterprise level? Is this memory … | |
heyyy every one .. can u guys write a c++ program to draw lozenge?? i tried to draw square triangle etc.. | |
As it is said in the title i can not get the keyword string. I finally found a version of C for windows 8 but now i can t get the most important thing types int, double char,bool ect... work perfectly and always show as a keyword but somehow i … |
The End.