49,761 Topics
| |
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 = … | |
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 … | |
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 … | |
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); } | |
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 … | |
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 … | |
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, … | |
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 … | |
` #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=|"; … |
The End.