49,757 Topics

Member Avatar for
Member Avatar for Web_Sailor

Hi, I want to prevent the sorting and preserve the original order in my container. below is the example. How can I do it ? string one = "6"; string two = "7"; string three = "2"; string four = "8"; veck.push_back(one); veck.push_back(two); veck.push_back(three); veck.push_back(four); veck.push_back("9"); veck.push_back("12"); veck.push_back("13"); veck.push_back("5"); I …

Member Avatar for Ancient Dragon
0
98
Member Avatar for asapgyritos

#include <iostream> #include <string> using namespace std; long getBarcode(long code); //Gets the Barcode from the individual. long verifyCode(); //verifys the code and makes the appropriate conversions. void displayCode(long& code); //Dislpays the barcode given by the individual. int main() { long code; displayCode(code); return 0; } long getBarcode(long code) //Gets the …

Member Avatar for griswolf
0
118
Member Avatar for douglaspr

Good afternoon, I have a problem reading a txt file in my dll Code: bool LeProtect () { char str [255]; FILE * arq; arq = fopen ("protect.ps", "r"); if (arch) { while (! feof (arch)) { fgets (str, 255, arch); printf ("% s", str); } } fclose (arq); } …

Member Avatar for douglaspr
0
107
Member Avatar for Isimanica

Simply put I have an array of Data that is a total of 40 numbers that are between 1 and 9. I know how to make a function display and calculate just the frequency of the array. I know how to create a histogram based upon data from the array …

0
55
Member Avatar for jae5086

I am just trying to end this program when the user chooses x or X but without the default "Enter a valid operator." The rest of the program works great (thanks to previous help). Sorry this isn't pasting perfectly. [CODE] do { cout << "Enter an operation: + - * …

Member Avatar for jae5086
0
179
Member Avatar for Bri426

Hello everyone :) My C++ class just started learning strings the other day. We were given a simple program that's due tomorrow, but I'm having a bit of trouble with it. I've emailed my teacher, who says I'm on the right track but need to fix something in my while …

Member Avatar for NathanOliver
0
192
Member Avatar for lauruskamj

[code=c++] #include <cmath> #include <iostream> using namespace std; void F2(int, int, int, int&, int&, int&); int main ( void ) { int X=1, Y=2, Z=3, A=4, B=5, C=6, A1=7, A2=8, A3=9; F2(X, Y, Z, A, B, C); cout << "X=" << X << "Y=" << Y <<endl; cout << "Z=" …

Member Avatar for NathanOliver
0
97
Member Avatar for OPTIMUS999

I have a payroll program that I been working on for a while and I gotten my code written. Yet, when I compile the program it keep giving me erros and I can't figure out why. I wonder is there anyone out there can tell me why I keep getting …

Member Avatar for NathanOliver
0
2K
Member Avatar for MindTrixz

Ok so I have the program set up for initial movement of two sprites that move toward one another and when they collide they return to their orignial position. But I need to know how to have them have randomized starting points and continue to move and bounce of the …

Member Avatar for MindTrixz
0
91
Member Avatar for rtdunlap

[code] #include <iostream> #include <conio.h> //needed to allow getch() #include <iomanip> using namespace std; int mean(const int [ ], int );//function prototype int main() // initializing the main program { char ch1; cout<<"Please enter the letter M for the mean function or the letter F for the Frequency function"<<endl; cin>>ch1; …

Member Avatar for Tellalca
0
111
Member Avatar for lasl0w

I have a case where I am not allowed to use the string class so I am using a char array. Does anyone have any idea why I am getting all the junk characters after my char array when i print? The input file is a 2 line file containing …

Member Avatar for lasl0w
0
9K
Member Avatar for techie1991

The last time I was making a program, I wanted to input from user a boolean answer (to save space ;)) An input of 0/1 works good (0-false) and (1-true), but if the user inputs the boolean values as "true" and "false", it comes out to be an error. So, …

Member Avatar for techie1991
0
228
Member Avatar for lauruskamj

Hey guys, I'm new here, obviously so if I do anything wrong let me know (gently). This program out puts x = 4 and y = 64 and I'm not sure why? [#include <cmath> #include <iostream> using namespace std; double Square(double); double Cube(double); int main(void) { double x = 2.0, …

Member Avatar for lauruskamj
0
105
Member Avatar for bejfake

Hi, I have to write game Minesweeper in OOP way. I have classes: Square which inherits to mineSquare, emptySquare, digitSquare and class Board which is responsible for initialize and control the game. I have such code: [CODE=c]#include <iostream> #include <typeinfo> #include "time.h" using namespace std; class Square{ public: Square(){ this->isShown …

Member Avatar for bejfake
0
176
Member Avatar for thr

hello I am c++ and java programmer and i want to develope user interface for aria2c ( internet download manager ) like IDM( windows internet download manager ) this software( aria2c ) programmed in c++ and i have one problem with this ( i never programmed user interface software with …

Member Avatar for myk45
0
210
Member Avatar for Jsplinter

I am trying to read in user input which is a file path (riddled with escape characters) into a CString. How can I do this without asking the user to replace '' with '\'? For instance: [code] CString myString; myString = _T("c:\test\file\j\mypath\path\user.bin"); wcout << myString.GetBuffer(myString.GetLength()) << endl;[/code] outputs: c: estQilejmypathpathuser …

Member Avatar for Jsplinter
0
269
Member Avatar for debasishgang7

i have a very basic c++ problem. this is my problem first i am assigning an integer. int i=000; when i am writing the value of this integer into a file its writing only one "0". How can i write the all four zero in the file. actually i have …

Member Avatar for Fbody
0
200
Member Avatar for doolali

Like it says in the title im having problems with putting a 2D array into a function. Im not sure on the syntax of putting an array into a function and using it, any help is much appreciated! Thanks in advance! [CODE]#include <cstdlib> #include <iostream> #include <string> using namespace std; …

Member Avatar for doolali
0
122
Member Avatar for odlanzednanref

im in trouble. this program would be easy if our professor taught the lessons well. but he's just like a student reporting his assignment. err. need your help..it would be so much appreciated. here's the problem: Virtual ATM Machine Problem Create a program that displays a log in menu that …

Member Avatar for Fbody
0
602
Member Avatar for cclausen7

I decieded to make a program that translates a phrase in english to "1337" or "elite". I have searched this website and others and can't find an answer to the error I'm getting. Thanks for any help :). Btw I'm using Bloodshed Dev C++, not sure if that matters. [code] …

Member Avatar for cclausen7
0
3K
Member Avatar for ramziabuabad

i write a function in c++ that take the name of obj file ... can you help me by tell9ing me how to read data using "in" and why his problem occur

0
93
Member Avatar for avataralien

I got a HTML file. I wish to parse the content I need to a text file. How can I make use of The unix utility application that strips the HTML markup tags from the file’s content leaving just content text? Thanks for the advise! [B][U]Partial HTML file code[/U][/B] [CODE]<thead> …

Member Avatar for shibblez
0
566
Member Avatar for ktsangop

Hi everyone! My function UsbID uses the libusb library ([url]http://www.libusb.org/[/url]) to get a flash disk's serial number. Libusb needs for some reason a Window created or else it doesn't work properly for me. So i created a CWnd inside my UsbID function which is invisible. My problem is that if …

Member Avatar for ktsangop
0
136
Member Avatar for baconswife

With this program I need to be able to find the circumference, area, diameter and radius of a circle. Here is what I have, please let me know of any advice you have: [CODE]#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main () { int x1; int x2; …

Member Avatar for Fbody
0
2K
Member Avatar for slychronic

Hello. i am looking for a C++ code that caaculates permutations...for example your input is abc output should be.. sample output is abc cba bca cab acb bac its just for revision so a full answer is appreciated...:)

Member Avatar for csurfer
0
130
Member Avatar for blessedboy123

Hey i have 1000 replicate files with a file name looks like below a.out1 a.out2 a.out3 ..... a.out1000 each file contains 12 rows and 12 columns including the header. a.out1 looks like this n col1 col2 col3 col4 ...........col12 1 0.3 0.1 0.1 0.11............0.5 2 .................................... 3 4 5 6 …

Member Avatar for mitrmkar
0
100
Member Avatar for Tiny_trixer

I'm just playing around with C++ as a preperation for coming assignments and well, exams. And I'm a little stuck with the switch statements. I've done this simple switch just to test the functions: [CODE] #include <iostream> using namespace std; int main(void) { char input; cout << "\nChoose function.\n1. Test …

Member Avatar for Tiny_trixer
0
116
Member Avatar for OPTIMUS999

I have a payroll program that I been working on for a while and I gotten my code written. Yet, when I compile the program it keep giving me erros and I can't figure out why. I wonder is there anyone out there can tell me why I keep getting …

0
71
Member Avatar for Photomotoz

Hi, I implemented a priority queue using STL. And that part is working great. Now, looking back on my problem it seems as though I need to know if a certain node exists in the queue. So I am looking some advice on what the best course of action would …

Member Avatar for csurfer
0
144
Member Avatar for qinise4

Hi Everyone I am currently writing a program in C++ which uses a very big matrix, I have been told to try and store the matrix in disc and try to retrieve only the chunks of the matrix I will be needing and keep swapping them around. The problem is …

Member Avatar for qinise4
0
2K

The End.