49,761 Topics
| |
I've been trying to do this for some time. I can do it with a vector but with a const void*, it crashes badly! My bad code: Bitmaps::Bitmaps(const void* Pointer, int Width, int Height, uint32_t BitsPerPixel) { Pixels.clear(); memset(&Info, 0, sizeof(BITMAPINFO)); width = Width; height = Height; size = ((width … | |
#include<iostream.h> class ADTqueue { private: int queue[10]; int head,tail; public: ADTqueue() { tail = -1; head = 0; } int empty() { if(head == tail+1) return (1); else return (0); } int full() { if(tail == 9) return (1); else return (0); } void append(int num) { if (!full()) { … | |
I'm a beginner so bear with me. I have a string and in it there is a character I want to remove. What is the best way to remove it? The shit I've found on the internet, it's making my head explode. I found this: str.erase(std::remove(str.begin(), str.end()), str.end()); Why is … | |
Good Afternoon, I'm fairly new to C++ programming, right now I'm having difficulties completing an assignment that consist of a student database. I really appreciated if someone would help me or give me some guidelines to complete the assignment. The assignment consists of that the database only generates one text … | |
please help with this program. I need to calculate the highestSalesand the averageSales using float funtions and displayOutput using void, I wrote the program but I can not get the output I get a lot of confusion. please help. when I'm trying to compile i get the error cpp:5 too … | |
http://www.daniweb.com/software-development/cpp/threads/267174/vigenere-cipher Read that. Was the full, complete code posted? If so, can I get a link or code? I want to refer to this when I get stuck with my project. | |
Hey guys I'm new to programing and I made a program to solve quadratic formula but it doesn't work with imaginary numbers when the number is negative I get something like this -1.#IND. What can I add or adjust in my code to help get the program to show imaginary … | |
**Dudearoo** *Useing Code::Blocks* Hey Guys! ive got a question, How can you find a string and then print after it?? ive searched google high and low and came out with nothing. What i want to do is to read a string(StringONE) and see if an other string(StringTWO) is in that … | |
my question is to Create a program to add sines and cosines of frequencies and plot them visually.eg addfreq out.jpg sin 0.2 cos 0.4 cos 0.7 This command will plot three curves (using different colors) and plot their sum as well at different discrete points.image magick++ is also to be … | |
Problem: The statement ++Chequebook1; should increment the member variable Balance of Chequebook1 by R100. Give three different implementations for the overloaded operator ++ to accomplish this: • using the member function Adjust() • implementing the overloaded operator ++ as a friend function • implementing the overloaded operator ++ as a … | |
hello everyone I was wondering if anyone could explain big-oh estimate to me for c++ data structures. I do not understand it that much and does anyone know of any good websites that have good information on c++ data structures i would greatly appreciate it. Also could anyone explain to … | |
Here's the entirety of my code. The problem I'm having trouble with is in the sortArray function. The first part of that function is used to sort the words gathered in a text file from A to Z, the second part is meant to find any duplicate words, ie 'a' … | |
I'm trying to have my program find duplicates in an array of strings, and if it finds one, it swaps the duplicate to itemamount - 1, adds +1 to the WordAmt for that word, and moves the loop one spot down. I just am not sure how to properly do … | |
So my task was to write a boolena method to count the number of live neighbour of a cell t is a 2D boolean array with a row and column position, i have to count the number of surrounding cells that contain the value true. So the index number given … | |
im using this code to send strings to serial port but this is very slow,the other end of communciation arduino board is not able to get those strings at realtime,how can i fasten this communication? there is no problem in arduino board or arduino code,it works fine for its sample … | |
I saw a thread here and didn't want to gravedig. I am a member of Hackforums.net, but no one there will help me. The code I saw involved multiple IFs inside a FOR loop. Now my question is, is there a working Caesar cipher I can refer back to when … | |
I am trying to output an arbitary double number (which might be negative) using only the printDigit for I/O, but when I run this program and you enter in a number is doesn't output anything. #include <iostream> using namespace std; void printDigit( int n ) { cout<< n; } double … | |
Hi, I am having this problem when i try to execute the .exe of my application "Debug assertion failed !, Expression invalid null pointer" After a bit of googling i think so i know where the problem lies, but have no idea how to solve it. Below is the relevant … | |
Hi all, I'm trying to set up a typedef for vector type in a header file I've named Container.h The struct is called Student_info and is in a file called Student_info.cpp with header file Student_info.h My code in Container.h is as follows; #ifndef GUARD_Container_h #define GUARD_Container_h #include <vector> typedef std::vector<struct> … | |
I'm trying to use a while loop to read in some files, but it only reads once and quits. Not sure what's wrong, professor says this is how it should work as long as I'm understanding him correctly. void populateStruct(ifstream &filein, WordStruct Words[1000], int &itemamount) { while (filein >> Words[itemamount].Word); … | |
How can I get a DLL's Parent Window Title? OR How can I get the PID of the process that loaded my DLL? I need this so I can make a file for each process that loads my DLL but the file has to contain some sort of identifier. Something … | |
Hello friends, I was trying to brush my programing skill and was not able to get answer of "why array size is different inside function solution1?" Inside main, size of array is 11 but inside solution1 its size is just 2. Here is my code... #include <iostream> #include <stdio.h> using … | |
I want to port some graphics applications in C++ which compile to Windows Executables to run as WEB apps. I don't want to throw away all the code I've written in C++, so it seems to me that Microsoft Azure would be prefect. My idea is that I learn to … | |
// Can Someone help me with the last function at the bottom. I am trying to display the top scorers, not just top scorer. If someone could point me in the right direction it would be greatly appreciated. #include <iostream> #include <iomanip> #include <string> using namespace std; struct Players { … | |
Hello, I need to write a program to take in a name (max 101 characters) and out store in into an array so that I can output it like a list. These 2 programs are apart of a bigger program that keeps asking if you want to add another name … | |
A student was arrested for drunk driving. There was some confusion during the arrest, which lead to the student's blood not being tested for alcohol level. The student was taken to the police station and at the station he was tested using an A.L.T. program. The A.L.T. program was developed … | |
Hi, I am totally new to lib png and png++ and have recently made my first project with these on linux. But have no idea how to use png++ on windows. I have my libpng configured on windows and am wondering how to move towards making png++ available and running … | |
The following are the requirements of the program and all code can be written within one C++ source file for the purpose of this assignment. 1. Declare three structs to store Athlete, Event and Registration details. The struct definitions are provided in Appendix 1. 2. Write the driver code (main) … | |
Could anyone tell me how to make a BSP tree?? like what things should i consider to implement it?? i'd be grateful if anyone gave me a list of basic steps to implement it..thank you |
The End.