49,757 Topics

Member Avatar for
Member Avatar for pattmorter

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 …

Member Avatar for WaltP
0
178
Member Avatar for a.muqeet khan

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 …

Member Avatar for Tumlee
0
163
Member Avatar for CodeNinjaMike

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, …

Member Avatar for mrnutty
0
4K
Member Avatar for jonnyboy12

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 …

Member Avatar for thines01
0
170
Member Avatar for kongkornitz

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 …

Member Avatar for thines01
0
149
Member Avatar for dellat

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 …

Member Avatar for dellat
0
117
Member Avatar for greatman05

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 …

Member Avatar for Ancient Dragon
0
207
Member Avatar for gunnerone

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 …

Member Avatar for gerard4143
0
191
Member Avatar for user543820

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 …

Member Avatar for L7Sqr
0
119
Member Avatar for a.muqeet khan

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 …

Member Avatar for a.muqeet khan
0
166
Member Avatar for Tygawr

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!

Member Avatar for Tygawr
0
253
Member Avatar for lanario

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 …

Member Avatar for LUDACHRl5
0
597
Member Avatar for Tygawr

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(); } …

Member Avatar for thines01
0
7K
Member Avatar for FraidaL

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?

Member Avatar for thines01
0
244
Member Avatar for Jorox03

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 …

Member Avatar for WaltP
0
209
Member Avatar for rbran74

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.

Member Avatar for pattmorter
0
132
Member Avatar for FraidaL

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 …

Member Avatar for FraidaL
0
232
Member Avatar for triumphost

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 …

Member Avatar for triumphost
0
149
Member Avatar for Prisms

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 …

Member Avatar for Prisms
0
204
Member Avatar for Tygawr

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!" << …

0
80
Member Avatar for Bennys

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, …

Member Avatar for mazzica1
0
98
Member Avatar for james6754

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 …

Member Avatar for jbennet
0
112
Member Avatar for triumphost

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 …

Member Avatar for mazzica1
0
179
Member Avatar for Kitson

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 …

Member Avatar for WaltP
0
814
Member Avatar for korek

#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; }

Member Avatar for Ancient Dragon
-1
29
Member Avatar for Suzie999

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 …

Member Avatar for Suzie999
0
257
Member Avatar for madhukesh

i want to do some projects in c++ ,which topic is easy to do project please give some suggestion

Member Avatar for zeroliken
0
52
Member Avatar for scottd82

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 …

Member Avatar for zeroliken
0
162
Member Avatar for ilearnz001

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 …

Member Avatar for ilearnz001
0
226
Member Avatar for johanjvanr

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 …

Member Avatar for johanjvanr
0
128

The End.