49,761 Topics

Member Avatar for
Member Avatar for SpottyBlue

I was practising with the past year questions for tomorrow's final exam. I wanted to read who has the highest score and show the highest score from the text file (see attachment). #include <iostream> #include <fstream> #include <string> using namespace std; ifstream infile; int main() { const int x = …

Member Avatar for Moschops
0
403
Member Avatar for sutty8303

I need help with this program. here is what we are supposed to do. The program should prompt the user to 'Please enter numeric grade: '. The program will then pass the numeric grade to a function that will convert to a letter grade. This function should have the following …

Member Avatar for Faisal Kazmi
0
18K
Member Avatar for wbsat

am trying to hook createfile and related file functions with a hook dll that uses MS detours.i also have an injector that uses the commonly known code such as openprocess->virtualallocex->writeprocessmemory->create remotethread. CreateRemoteThread returns sucessfully but there is no evidence the dll is getting injected successfully in the target process.A test …

0
72
Member Avatar for hendraligawan

Please help me to understand the algorithm from this source code. int time(){ time_t rawtime; struct tm * timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); cout<<"Current time: "<<asctime(timeinfo); }

Member Avatar for Ancient Dragon
0
104
Member Avatar for hendraligawan

I have a problem when I do my task. task: Made a program about queue in Bank teller system. Teller A if deposit <=10million, teller B > 10million the count of customer(queue) is random and the price if deposit is random too. output: how much customers,time and total transaction at …

Member Avatar for hendraligawan
0
197
Member Avatar for chubbyy.putto

Can someone kinda check this one to see what wrong with it? #include <iostream> using namespace std; int ture ( int a[], int b[], int d); int main () { int b [5]={1,2,3,4,5}; int a [5] ={1,2,3,4,5}; int total= ture(b, a, 5); cout << total << endl; } int ture …

Member Avatar for gerard4143
0
107
Member Avatar for Labdabeta

Hello, I can get OpenGL to render 3D scenes to the screen, but I want to render them to a pixel array. Basically I want some magical code to fill in the blanks for this code segment: int width=500; int height=500; uint32_t *colours=new uint32_t[width*height]; //Magic code! glBegin(GL_TRIANGLES); //other drawing stuff, …

Member Avatar for Labdabeta
0
5K
Member Avatar for refphlex

Hi, I've been having trouble getting the average and letter grades to print and they are outputting as 0 .. I tried everything calling the average function etc. but I still get a zero. Any advice? I don't have any other problems just need help with the average function and …

Member Avatar for refphlex
0
439
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
400
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
106
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
396
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
433
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
518
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
208
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
164
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
152
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
592
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
156
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

The End.