51,593 Topics

Member Avatar for
Member Avatar for cousinoer5

I'm taking an advanced C++ class now, and everything up to now has been pretty simple (mostly review stuff), but now we got to binary file io and it's kicking my butt. This program is supposed to read from a file called "Hardware.dat" (or create it if it doesn't exist), …

Member Avatar for cousinoer5
0
485
Member Avatar for reemhatim

long seats; long no_of_guests; long fact=1; cout<<"Enter the number of seats nn"; cin>>seats; cout<<"nnEnter the number of guestsnn"; cin>>no_of_guests; for(int i=0;i<seats;i++) { fact*=no_of_guests; no_of_guests--; } cout<<"the possible combinations : "<<fact<<"nn"; this code has run successfully but there is a something that I couldn't get first this program will run this …

Member Avatar for Momerath
0
86
Member Avatar for HMehrpouya

[QUOTE] I want to have two classes one for creating the dataset as a factory class and the other is my Dataset class. factory class could read data from files or memory address and also it can create random data and finally returns a dataset. first i want to implement …

0
60
Member Avatar for plang007

Could you please tell me how to arrange my code so that the invalid statement like in my displayed output will only show up if some enters a wrong character. Here is my code: #include <iostream> #include <fstream> #include <iomanip> #include <cmath> using namespace std; int main() { //(1) Declare …

Member Avatar for mcriscolo
-1
638
Member Avatar for JaviP

Hello, I am new to C++ programming. I need to do this problem for a class but I'm a bit stuck, it's giving me many errors, could anyone point out what the problem is please? This is the problem: A country club, which currently charges $2,500 per year for membership, …

Member Avatar for JaviP
0
623
Member Avatar for TheAgent1982

I am newbie in programing, and learning it... I need to know how do i make that program: Examples will help... I need to use UDP communication to connect to server by client and search, at server,for the longest directory, get the longest directory path and number of deepest level, …

Member Avatar for TheAgent1982
0
261
Member Avatar for alex55

on line 32 how would i go about inputting a file name to be called by my function which im using a const char pointer for the file name line 33) error C2664: 'calculationOutput' : cannot convert parameter 1 from 'char' to 'const char *' [CODE]#include<iostream> #include<fstream> #include<string> #include<iomanip> using …

Member Avatar for jonsca
0
109
Member Avatar for VasquezPL

Hi...I have a problem.. I need a function which is able to remove a word from string and replace it with other word (string).. I have nice working function in pure c++ but I dunno how to do that in visual c++ ;( 10x for help! [code] void FindAndReplace( std::string& …

Member Avatar for VasquezPL
0
191
Member Avatar for alex55

how would i go about doing the std output to a file for this line? to be more clear i want it to append to the file not overwrite because i run the function multiple times outputting to the same file [CODE]std::outFile << "The area with the highest average temperature …

Member Avatar for alex55
0
136
Member Avatar for niranjan889

Sir, i have done this code but an error is coming...... [B]the function getline should have a prototype undefined symbol 'string' [/B] what shoul i do? I am compiling this code in turbo c++ compiler..... [CODE]#include<string.h> #include<iostream.h> #include<conio.h> using namespace std; int main() { string number; string name; cout << …

Member Avatar for VernonDozier
0
93
Member Avatar for Muhammadlodhi

Hi .. i want to print this pattern of number using loops . if input is 5 then output should be ... 155555 224444 333333 444422 555551 i have solved 1 22 333 4444 55555 but another reflection is not coming in my mind ... and making me confuse need …

Member Avatar for Muhammadlodhi
0
109
Member Avatar for Martje

I have been trying to capture the enter key in a windows.net textbox but i have no idea how to do it, i googled searched but the only examples i find are visualbasic and c# ones and when i try to do thesame thing in c++ in doesnt work. I …

Member Avatar for Martje
0
471
Member Avatar for night2night3

Hi, I'm working on a linked list filled with class objects and I've encountered a weird problem that I cannot see how to resolve. I declare 2 self-referential pointers within my 2 classes and the error: In file included from prog2.cpp:16: employeedatalist.cpp: In function âvoid getData(std::fstream&)â: employeedatalist.cpp:15: error: âheadâ was …

Member Avatar for Sky Diploma
0
288
Member Avatar for biancaW

is there another way to write this code other than using bool for validation [CODE]bool isValid = true;[/CODE]

Member Avatar for arkoenig
0
75
Member Avatar for darelet

Hi all, I'm trying to implement a blob coloring/region labeling algorithm to find and label all blobs/objects in a given image so that at the end of it, I can eliminate all but the largest object. I represented the image by a mask matrix (int binary[image size]) where zero co-ordinate …

0
94
Member Avatar for akase2010

i put the numbers into my calculator and i receive a number that is about $1 greater than the actual value. why? [CODE] #include<iostream> #ifndef Tips_H #define Tips_H using namespace std; class Tips { private: long double taxRate, bill, gratuity; public: Tips() { taxRate = 0; bill = 0; gratuity …

Member Avatar for caut_baia
0
226
Member Avatar for AnonymousX

Well, Hello Again! I'm now using pure C++, too hard But well. I just love how you can manage everything Windows have, is like owning Windows. But well, i have some issues: [CODE] extern "C" __declspec(dllexport) char *getValue(char *valueName) { HKEY hKey = HKEY_LOCAL_MACHINE; LPCSTR lpSubKey = "SOFTWARE\\Dantom\\BYOND"; PHKEY phkResult; …

Member Avatar for Ancient Dragon
0
264
Member Avatar for plang007

#include <iostream> #include <fstream> #include <iomanip> #include <cmath> using namespace std; int main() { char fare; char choice='Y'; int hrIn, minIn, hrOut, minOut; int hours; int minutes; int total_minutes; double cost; float charge; float additionalTime; while(choice=='Y'||choice=='y'){ cout << "\nThis program will calculate a single, couple, or group " << "\nfare …

Member Avatar for Sky Diploma
0
333
Member Avatar for ntrncx

ok i have i want to summarize only the first collum [CODE]int counter=1; int totalvertical=0; int i=7,k=4; int array[i][k]={random values}; for (int x=1;x<7;x++) { for (int y=0;y<4;y++) { cout<<"["<<x<<"]["<<y<<"]="<<array[i][j]<<" "; totalvertical=array[counter][0]; cout<<totalvertical; } counter++; cout<<endl; }[/CODE] line 12 prints me normaly what is at array[1][0] then array[2][0] then array[3][0] etc …

Member Avatar for ntrncx
0
149
Member Avatar for rachaelginge

I need to get codes for ADD DELETE SEARCH (WHICH GOES TO ANOTHER FORM WHEN CLICKED) UPDATE (WHICH UPDATE AND SAVES RESULTS) [ATTACH]19289[/ATTACH] just the code for that thank you! :) it's from a SQL Database;

Member Avatar for Mitja Bonca
-1
128
Member Avatar for lochnessmonster

i dont see how this is possible but....is there a way i can have a literal value in my program....such as the number "1" represent a specific variable? for example int sum; sum = 1 + 3; <--- i want my program to read this as add "3" to the …

Member Avatar for Red Goose
0
110
Member Avatar for Danny1994

[CODE]void Form1::textBox9_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) { if(!Char::IsDigit(e->KeyChar) && (e->KeyChar != 0x08)) e->Handled = true; }[/CODE]Thats the code i got, but, how could i allow CTRL+V. [CODE] if(Char::IsDigit(e->KeyChar)) return; if(e->KeyChar=='\b') return; if(e->KeyChar=='\v') return; if(e->KeyChar=='CTRL') return; e->Handled=true;[/CODE] This also doesn't work ._. (Im using Visual Studio 2010)

Member Avatar for Danny1994
0
342
Member Avatar for TheLittleEngine

[CODE]void Rational::reduce(Rational &f3){ int tnum, tden, temp, gcd; tnum = labs(numerator); // use non-negative copies tden = labs(denominator); // (needs cmath) if(tden==0 ){ // check for n/0 cout << "Illegal fraction: division by 0"; exit(1); } else if( tnum==0 ){ // check for 0/n numerator=0; denominator = 1; return; } …

Member Avatar for TheLittleEngine
0
191
Member Avatar for fsefsef23

Hey all! I have polynomial programming project that I'm doing where I need to read a set of numbers from a file where each set of numbers are written in the format <coefficient> <exponent> on each line in the file. First and foremost I've set up a structure called Term …

Member Avatar for jonsca
0
94
Member Avatar for MaDo4

Hi guys i'm trying to write code that requires the user to hit return twice to terminate the project and I can't figure it out. I think i am supposed to use some variation of [CODE] if(input == " "){ exit(1); } [/CODE] with a Boolean expression but I can't …

Member Avatar for MaDo4
0
2K
Member Avatar for aakashjeyapal

Hi... I need to establish a connectivity for mysql in c++ on a linux fedora 12.0. please let me know a solution.

Member Avatar for jonsca
0
48
Member Avatar for Casper3912

I am in a distributed education programming class, our most recent assignment has me stumped with a error that is driving me insane. The IDE I have on my personal computer is missing some of the libraries I need(I believe), and when I remote desktop to my school's computer and …

Member Avatar for VernonDozier
0
360
Member Avatar for BrownianMotion

How would you write a function that takes in n and i (integers) and outputs the ith least significant digit of n?

Member Avatar for Momerath
0
40
Member Avatar for spoonlicker

[B]I'm extremely confused using external graphics sources such as OpenGL or DirectX or even Windows API to do such simple tasks. I want to be able to take a step forward and learn how to draw a bitmap or such on to a window. Thing is I have not a …

Member Avatar for spoonlicker
0
106
Member Avatar for mpike

Ok heres my problem i was told to make a simple tower of hanoi project (standard for C++ courses) heres what i have it works pretty well the only problem i have is that i need to number the discs from smallest to largest and tell which is moving. i …

Member Avatar for spoonlicker
0
108
Member Avatar for Mr.UNOwen

Hello, Does anyone know a good cross platform library that can handle mouse and keyboard (and joystick if possible) events without needing to producing a window?

Member Avatar for Mr.UNOwen
0
82
Member Avatar for skorm909

I started this game a few months ago and I decided to finish it up, but a problem im having is with my arena. basically the "Arena" is the final thing to the game. If you beat the arena you win the game. whats wrong with it, is that when …

0
77
Member Avatar for lochnessmonster

i've seen certain coded functions in programs with _declspec before the function return type and name....I read the microsoft documentation on it but i still don't understand what it means and when/why it is used! -thx *EDIT* i meant _declspec not cdecl **

Member Avatar for caut_baia
0
52
Member Avatar for SeePlusPlus2

I started learning about objects and classes this week and it's really confusing. I'm trying to make a class/object to read data from an input file and use the values to calculate the profit loss/gain(in percent and numbers). So far when I try to run the program I get an …

Member Avatar for SeePlusPlus2
0
200
Member Avatar for alex-VX

Hi im kinda new to c++ and dont know mutch aboute unsolved externals this is what i get: [ICODE]pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MovePawn(int,int,int,int,struct Piece (* const)[12])" (?MovePawn@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z) pices.obj : error LNK2019: unresolved external …

Member Avatar for alex-VX
0
168
Member Avatar for geekme
Member Avatar for papayrus

[QUOTE=AdventGamer;1349519]ok well i'm having issues sending a char array to a listbox. To do a little explanation on the code itself... The point of this part is to take a hexidecimal string and convert it to a alphabetical string (this part works and has been tested in a console application). …

Member Avatar for chrjs
0
117
Member Avatar for mrnutty

The simplest sort, although inefficient. Below is a demonstration of bubble sort and insertion sort. The bubble sort just consists of 2 for loops and std::swap. The insertion sort uses 2 loops as well but not as much swap as bubble sort. Any questions ?

Member Avatar for 88omar
1
434
Member Avatar for maikens

Hi all, I'm working on a project in my Data Structures course, using Binary Search Trees. As part of the project, we need to balance the tree. I have decided to try and make an AVL tree. I am having a problem with the rotations in particular. Somehow during the …

0
76
Member Avatar for geekme

Hey ., need to know does turbo c work for ubuntu as well and if not what editor-cum-compiler should be used? Thanks

Member Avatar for ravenous
0
173
Member Avatar for jugadengg

hi could anybody guide me how could i install latest version of GCC on my window 7 computer. thanx!

Member Avatar for Stefano Mtangoo
0
131
Member Avatar for majyun

Hi there, I am new to the forum. I know this topic is not new. I have did a search on it and did not quite get what I wanted. Currently, I am trying to write a c++ programme which help me to read in about 10000 rows of numerical …

Member Avatar for jonsca
0
228
Member Avatar for xcarbonx

Hi..i'm having some trouble coming up with the an algorithm for a problem im working on. I am trying to check an arithmetic infix expression like: (((6+2)/2)*(3-1)); //This is my input file(; marks end of line.) I have to check to see if the statement is ok, or not ok, …

Member Avatar for L7Sqr
0
94
Member Avatar for jkoske

Right now I am using gdb on command line in Ubuntu. It seems pretty inefficient and cumbersome. Is that just because of the learning curve or because it is really that way? Do "real" c++ programmers use gdb? I felt the same way about vi until I learned to use …

Member Avatar for Stefano Mtangoo
0
109
Member Avatar for KazenoZ

Hello, I'm having this problem with the transparency in GDI+. I have 2 pictureBoxes, one over the other, and one of them has their alpha color set to magenta(255, 0, 255). My goal is that when the upper pictureBox has a picture on it with a section of the magenta …

Member Avatar for KazenoZ
0
135
Member Avatar for benny2010

Hey im creating a cache simulation in C++ i have the read/write policies and most of the eviction policies but im struggling to get my head round adaptive replacement cache. i kind of understand how the two lists work but not very well. If anyone could help explain it to …

0
86
Member Avatar for music613

I need to take the content of a C# datatable and deposit it (...) in a new Excel spreadsheet. I have seen some good generic code to do this, however, my problem is that I need to be specific, column by column, as to the format of the cells. For …

Member Avatar for Momerath
0
189
Member Avatar for TheLittleEngine

The parts I am having trouble with are: The private section of the class should also include two member functions that will a) reduce a fraction to lowest terms b) normalize a fraction (the only sign appearing will be a negative sign in the numerator.) for part a) I have …

Member Avatar for TheLittleEngine
0
725
Member Avatar for er.shalini10

hi, i wanna know the program for the query given below. i will be thankful to u. query: Seat Reservation prog for the theatre. Write a function for seat allocation for the movie tickets. Total no of seats available are 200. 20 in each row. Each row is referred by …

Member Avatar for elsiekins
-10
1,000
Member Avatar for eduard77

I just learned c++ and is very hard for me to put in practice what I learned. So, I would like to know if anybody could help me by giving me tasks and helping me to solve them. Thanks

Member Avatar for eduard77
0
257

The End.