49,757 Topics
| |
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; } | |
Have a situation with my code, where it appears the stringstream object is not being cleared. Here is my code, this code will set an interprocess shared variable, The code is simplified to illustrate my problem, and all other variables are there to aid in that, for instance, the ints … | |
i want to do some projects in c++ ,which topic is easy to do project please give some suggestion | |
I don't know where to begin, so I'll start with what I know. First, I have a remote control. Second, a chip. The remote control has two directions, left and right. The chip receives the signal and then moves in the direction accordingly. Now, what I want to do is … | |
Looking To learn how to send data from a program to a webservers webpage. More specificly sending the data to <form> tag within a html file. Trying To Find out how to do this, code examples would be prime. Also Any Guides on connecting proxies -- who then connect to … | |
Hi all I have to write code that ask the user to input a current (that will be split into two currents) and then the output from the code should display the two resulting currents given two input resistors. That part I can do but my problem is I have … |
The End.