49,761 Topics
| |
Hi guys, Found this thread while searching to solve my problem ... anyone an idea why this snipet leaks? [CODE]void testMemoryLeak() { HINTERNET hSession = WinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); WinHttpCloseHandle(hSession); } [/CODE] a 20'000 loop brings memory up to 19MB VS2008 on Win7/64 building a console application Win32 Cheers … | |
For a project I'm doing for class I have to make a virtual method in a class. A subclass will inherit the virtual method and instantiate it in a separate .cpp file. The problem I'm having is that I need the class that has the virtual method to instantiate its … | |
I need help with this assignment. I got some done for the input validation but im having problems to understand classes. Ill provide the code below. Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter default constructor … | |
[CODE]int initScoreX; int initScoreO; int oldScoreX; int oldScoreO; int newScoreX; int newScoreO; int ScoreBoard(char Player) { int ScoreBoardPositions[99]; //counting all the way to 99 //let's say X won that round, so I add 1 to the old score oldScoreX + 1 = newScore; //let's say the new score is 16 … | |
i need help with this program, i need to give the user 20 chances to guess, and they should be asked if they want to playagain.(by playing again i mean generating a new number with 20 new chances) after playing for how many times i should count the number of … | |
So I was doing some code for input validation on my homework program and i have the correct code to make sure a number entered it correct but I thought, what if they enter a letter. We aren't required to make sure that the user entered a number but how … | |
hello guys ! i have created a program just to understand how to return a value from using a recursive program what it does it thati have have two variable i.e first and last the value of first is zero and last is 10 not i want the function to … | |
Ok, I've been trying to wrap my head around this code for the longest time today, and I've tried to look up multiple web pages on how to solve my issue in a different way, but it's no use. There's something that Im not seeing that separates a regular array, … | |
Hello i am finishing up a pop3 program and now am looking for a way to view the html i receive form the pop3 server that comes along with some messages. People have told me to use a web browser but that seem over kill. Could i dissect a web … | |
Hi, need help with an assignment. Here is the problem and the code the I came up with. It displays the start and the end but it does not display the numbers in between. Thanks in advance. ;) [CODE]//create a C++ program that will accept 2 numbers: (Start Number and … | |
I have a question on a very basic operation of modulo operator. [B]Why does 1 % 9 produce 1?[/B] If 10 % 9 then remainder is 1. I am very poor in math but have had to use modulo operator many times before but always become confused and couldn't understand … | |
So, I'm a bit confused with how inheritance works in relation to variables. Let's say that I had the following class: class Test { private: int var1; float var2; public: void getInfo(int,float); void setStuff(int,float); }; Now, let's suppose that I wanted to derive a class from that base class; I … | |
Hi I am working on Linux and I am trying to create a GUI app to go with my executable I have made. For some reason it unexpectedly ends. There is no error message, it just says in the Qt console window it unexpectedly ended with exit code 0. Can … | |
Hello! I am trying to implement search algorithms in a 2D grid. The problem I am facing is that let's say that I make a 2D grid in c++ through some array and also block some cells. Now how will I convert this grid into a binary tree to run … | |
hello guys ! i have created a program just to understand how to return a value from using a recursive program what it does it thati have have two variable i.e first and last the value of first is zero and last is 10 not i want the function to … | |
Hello everyone, I've attempted to use ifstream to open and read a 20GB file but failed to do so (it takes a very very very long period of time...). So, I need find a fast way to open and read a 20GB .txt file in C++. Thank you! | |
I'm lost based on the code provided, how to reduce a fraction down. I've looked on the internet and yes most are using global variables; I however, can not for my class. It must be within the function. And there needs to be two calls outside of each of the … | |
Hello everyone, I am having a hard time reading and writing a UTF-8 file in visual c++ 2010. [CODE] void ReadUTF8File() { ifstream UTF8File("C:\\DaniWeb\\Desktop\\UTF8File.txt"); /* UTF8File.txt: ☺☻♥♦♣♠•◘○ */ string UTF8FileStr; if(UTF8File.is_open()) { while(!UTF8File.eof()) { UTF8File >> UTF8FileStr; cout << UTF8FileStr << endl; /* cout: ∩╗┐Γÿ║Γÿ╗ΓÖÑΓÖªΓÖúΓÖáΓÇóΓùÿΓùï */ } } UTF8File.close(); } … | |
I'm receiving this error when I'm trying to run my program: Program received signal: “EXC_BAD_ACCESS”. Does anyone know what this means? | |
I'm doing an assignment for school which is to simulate the grep command in C++. We are to take in a word to search, an input file to search through, and output file to output the results. The only text that should be in the output file is the contents … | |
when using setprecision(2) when i try to display the number .90 it olny outputs .9 is there anyway to make it so that it display .90 instead of .9. | |
I'm writing this program to calculate the best fit line. It's not finished. I'm doing it step to step to make sure it runs so I don't get lots of errors and totally freak out at the end. Right now it runs fine, but something is really off with the … | |
I'm trying to help someone with homework.. So you do not have to give me direct answers if you don't want to.. it is not my homework. [CODE] class Types { //No default constructor.. Types(int Param1, int Param2); }; class Objects { public: Types* Original; Objects(); ~Objects(); }; //The problem … | |
I am trying to compare a string from my text file to a user input i was wondering how I would do this I have tried the == operator but that seems to be getting me no where. I am currently trying to use the .compare() but it doesn't seem … | |
OOPS! SORRY WRONG SECTION, I WANTED TO POST IN THE C++ SNIPPETS.. This piece of code will search for a string in a text file and write the results into another file along with the line number. [CODE] void IOSearchString() { string SearchString, InputFilePath, OutputFilePath, InputFileLine; cout << "Welcome!" << … | |
Hello, I have a linked list with the following data in it reflecting a title (name), int (# copies) and float (price). I'm supposed to sort this linked list by prices (highest to low) and then print the titles. From what I've seen, the best method is using selection sort, … | |
I have a pointer to an array of integers... [CODE] double* three = new double[10]; for(int i = 0; i< 12;i++) { three[i] = i+1; } [/CODE] I assign i+1 to each place in 'three'...when I debug the code, I cannot see the values inside 'three' like in C#..it just … | |
I need help changing my return type from int to vector<string>.. I don't want to have to pass the vector as a pointer to the function but rather I just want to return the vector itself as I no longer need to check the return type. If it fails, it'd … | |
Hi Guys, I'm really struggling getting to grips with C++ I need to read a .txt file which contains something similar to this: [CODE]Eng.Speed Torque 1000.0, 34.55 3800.0, 46.58 6600.0, 47.44 9400.0, 48.75 12200.0, 39.79 15000.0, 24.61[/CODE] I'm trying to: .Open a file named torque1.txt .extract the data .I want … | |
#include <iostream> #include <fstream> #include <string> #include <windows.h> using namespace std; int main() { system("restart -f -s -c \"messege please write here!\" -t 30"); return 0; } |
The End.