49,756 Topics

Member Avatar for
Member Avatar for pphamtuan

` #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 …

Member Avatar for Ancient Dragon
0
399
Member Avatar for Rohan_1

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

Member Avatar for Ancient Dragon
0
202
Member Avatar for chubbyy.putto

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 …

Member Avatar for Learner010
0
105
Member Avatar for james.lu.75491856

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 = …

Member Avatar for gerard4143
0
266
Member Avatar for jonathan710

#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) …

Member Avatar for richieking
0
332
Member Avatar for furalise

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 …

Member Avatar for furalise
0
423
Member Avatar for ashu.dasgupta
Member Avatar for Quân

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 = …

Member Avatar for Ancient Dragon
0
514
Member Avatar for chubbyy.putto

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 …

Member Avatar for chubbyy.putto
0
207
Member Avatar for Capi

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 …

Member Avatar for gerard4143
0
152
Member Avatar for sarah.mathieson.7

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 …

Member Avatar for sarah.mathieson.7
0
163
Member Avatar for Jamblaster

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 …

Member Avatar for diafol
1
376
Member Avatar for Ms.toumi

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 …

Member Avatar for ObSys
0
151
Member Avatar for jackslv

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 …

Member Avatar for jackslv
0
232
Member Avatar for naamulhadi
Member Avatar for manel1989

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; …

Member Avatar for Ancient Dragon
0
529
Member Avatar for cambalinho

can i create 1 template that i use inside the class and not when i create the class object?

Member Avatar for mike_2000_17
0
155
Member Avatar for laila_2

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 …

Member Avatar for laila_2
0
841
Member Avatar for hobaa414

iwant to implement an elevator simulator which will emulate the behavior of a system with two working elevators.

Member Avatar for abdul.mudaser
0
1K
Member Avatar for srinath reddy

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.

Member Avatar for Jeff_11
0
1K
Member Avatar for beastie805

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 == …

Member Avatar for beastie805
0
155
Member Avatar for skyyadav

//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=|"; …

Member Avatar for tinstaafl
0
103
Member Avatar for HenryR7

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 …

Member Avatar for richieking
0
186
Member Avatar for jonathan710

// 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 …

Member Avatar for nullptr
0
256
Member Avatar for cambalinho

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

Member Avatar for cambalinho
0
5K
Member Avatar for jonathan710

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 …

Member Avatar for Ancient Dragon
0
148
Member Avatar for ariel930

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 …

Member Avatar for richieking
0
5K
Member Avatar for Tyler_1

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 …

Member Avatar for Tumlee
0
316
Member Avatar for saja.omarii.7

heyyy every one .. can u guys write a c++ program to draw lozenge?? i tried to draw square triangle etc..

Member Avatar for saja.omarii.7
0
103
Member Avatar for castajiz_2

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 …

Member Avatar for Ancient Dragon
0
290

The End.