49,757 Topics

Member Avatar for
Member Avatar for azjherben
Member Avatar for shuda009

Hi, I'm new to the C++ community hope you guys can give me some guidance. The program I'm making is suppose to read information from a file called music.txt Inside this file there is information about songs in the following format: Bandname, Songname, Duration of the Song, Here a partial …

Member Avatar for Stinomus
0
1K
Member Avatar for DarthPJB

Hello, my first post here, mostly due to every question I placed on google the answer is here (normally answered by a fellow Anime fan called Narue, someone's got their thinking cap on ^_^) Anyhow the problem is as follows, I'm writing a 2D game engine using DirectX9 (not relivent …

Member Avatar for Stinomus
0
771
Member Avatar for LostByte

Ok so im totally new to C++......we use Dev in our labs I cnt seem to figure out how to store the column of a text file into an array. I understand how to input the file usinf ifstream.The columns have Lastname(initial), Id#, Age and Gpa. i thought js doin …

Member Avatar for Topi Ojala
0
128
Member Avatar for gsingh2011

How would I make a program that can insert text into a text field in another program? Or click a button in another program?

Member Avatar for Stinomus
0
123
Member Avatar for ganbree

Okay, I've got a serious problem with std::vector, the code I'm working with is huge and it's got vectors left, right and center. The problem is that one of the vectors is having to reallocate itself elsewhere. This is causing the references to point to random things. For illustrative purposes: …

Member Avatar for ArkM
0
93
Member Avatar for Bythos

Hi folks, Fresh newbie here. I'm taking a c++ class and I'm just a beginner. We have started to learn pointers and I discovered some puzzling behavior while messing around with the address operator [ICODE]&[/ICODE]. Here is my code snippet: [CODE] char letter = 'a'; int integer = 1; char …

Member Avatar for trillionaire
0
217
Member Avatar for Lothas

I'm having some problems trying to solve an apparent circular dependency in a project of mine. I'm working with OpenGL and FLTK to create a Robotics Simulation. The problem is that I've created a Class FLGLWindow which basically manages a window with rendering capabilities. I also have a Menu class …

Member Avatar for Ancient Dragon
0
301
Member Avatar for vlakarados

Searched your forums a lot, found a solution to my task, but still I do not understand why do I get the wrong answer everytime. It's always a 'correct-1' result. It doesn't depend on what the number in the string is. [CODE=C++]#include <cstdlib> #include <iostream> #include <string.h> using namespace std; …

Member Avatar for vlakarados
1
1K
Member Avatar for ganbree

I'm trying to port some existing C++ code to OS X. The problem is that it doesn't want to load files to read from them. The code bellow illustrates this problem; when run from Finder it outputs "Failed to open input file.", however when run from Xcode it runs correctly. …

Member Avatar for Narue
0
138
Member Avatar for Mr Bin

[B]Please help me how to do it. Thanks![/B] A 5-star hotel has 3 room types below: - Room type A, Price 80 USD / day. - Room type B, Price 60 USD / day. - Room type C, Price 40 USD / day. Room rental is calculated by formula: Price …

Member Avatar for mvmalderen
0
111
Member Avatar for u8sand

Hello everyone. This is not really a coding problem as it is more of a compiler problem. I am making an MFC application in Visual Studio 2005. When i open up the icon, i can edit it right there in that editor. But when i do, it works fine in …

Member Avatar for GadiK
0
137
Member Avatar for phoenix911

all i can do is get each line at a time.... how can i read it to only read till the space.... plz help.... heres my lil bit of code [CODE] while (getline(iofile,line)) { cout << line << endl; }[/CODE] plz i know i can use this aswell for line …

Member Avatar for Ancient Dragon
0
120
Member Avatar for toolmanx

I spent a lot of time trying to find out why "Message Box' made my program act like it crashed. Originally I had to bring up the Task Manager every time I allowed "Message Box' to run to shut down the program. After much experimentation I found that if I …

Member Avatar for toolmanx
0
107
Member Avatar for gretty

[B]What would be the best way of doing this?..... [/B] I have a text file containing a list of music songs that shows the artist, song title & song duration. So I'm writing a program that opens the text file & reads the duration of each song, adds each song …

Member Avatar for Raven6666
0
310
Member Avatar for gretty

Hi :) How do you write a program that reads a text file (music.txt) & stores it in a Data Structure. I hope that I explained this well but here is a little more info incase not [QUOTE]Write a program that reads the data from the music.txt file and store …

Member Avatar for Ancient Dragon
0
90
Member Avatar for zack.walters

Ok, here's the deal. I have this homework project I'm working on and while I realize no one is here to do my homework I am a little confused right now with how to get a function to read into an array. I put in the entire code but I …

Member Avatar for ithelp
0
213
Member Avatar for szcfama

WHEN DATA IS READ FROM FILE AND I SELECT DISPLAY ALL IT FIRSTLY DISPLAY THE INFORMATION FROM THE FILE AND FILLS WHATEVER LEFT OUT OF THE10 RECORDS WITH WEIRD SYMBOLS. [CODE=cplusplus] # include <stdio.h> # include <string.h> # include <iostream> # include <fstream> #include <stdlib.h> using namespace std; typedef struct …

Member Avatar for amrith92
0
124
Member Avatar for OffbeatPatriot

I'm making a program in Ubuntu with wxwidgets, the goal is to recognize faces but for now I just want to load an image into a frame. I load images by clicking on a load menu item which is linked to this function. [code=c++] void Face_Catcher_Frame::on_load(wxCommandEvent &event) { wxFileDialog * …

Member Avatar for Salem
0
346
Member Avatar for Stefano Mtangoo

I have simple question. I have long code in my .cpp file with classes functions etc. I would like to divide it into separate cpp and .h files. What are rules governing the stuffing? Any good tutorial/example? Cheers :)

Member Avatar for Stinomus
0
94
Member Avatar for K'rul

Alright i am trying to read from a file so that it opens into the array temp_array. the idea is to have the data previously added to the file open into the array so i can search it and sort it this is giving me alot of stress it is …

Member Avatar for szcfama
0
239
Member Avatar for Daria Shmaria

I'm writing a spellchecking program using a hash table. The hash table (a char * array) serves as the dictionary, storing words inputted from the file wordlist.txt. When I call the lookup function, a floating point exception occurs. Any suggestions you have on how to find what's causing the exception …

Member Avatar for Daria Shmaria
0
399
Member Avatar for nschessnerd

Hey, I need help keeping a http connection alive. I have used setsockopt to set keepalive to 1, and in the http packet i set keep-alive to 300, but the server replies with: [code] Connection: close[/code] my packet looks like [code=cplusplus] string buffer2="POST "+P.path+" HTTP/1.0\r\nHost: "+P.httpUrl+"\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows …

0
92
Member Avatar for Koldsoul

Summary of task: I have to write a program that adds 3 places to each char of a user input string to encrypt and vice versa for decrypting. Doesn't seem to hard, but as a beginner I am having an issue. I am having problems getting the user input string …

Member Avatar for NathanOliver
0
4K
Member Avatar for GrilledTuna

Hello, I'm writing an abstract program that keeps a record of Names and Phone numbers. I've created a Record class that inherits a Name and Phone class. All the functions work great except for delete. The delete function is supposed to replace the record value with "DELETED". The program says …

Member Avatar for GrilledTuna
0
89
Member Avatar for timb89

[code] #include <iostream> #include <cstdlib> #include <cassert> using namespace std; struct node { int info; node *link; }; void insert(node *first, node *here, int x) { node *temp = new node; temp->info = x; if (first == NULL) { first = temp; } else { here->link = temp; } } …

Member Avatar for siddhant3s
0
70
Member Avatar for gretty

Hi I am trying to write a function in a program that reads a 2d array withs 2 rows & determines the largest number & whehter that number is in row 0 or row 1. For example: [QUOTE]Enter distinct integers for a 2d array with 2 rows and 5 columns. …

Member Avatar for Ancient Dragon
0
6K
Member Avatar for Mijchael

I need to use a webcam for a project where I need to control cam's internal parameters. I know that I can find in the market cameras with some API's, like logitech. For the other side I know I can do something with DShow and Windows Driver Development kit. Someone …

0
68
Member Avatar for Leopold

I'm trying to teach myself C++ through internet tutorials and such. Right now I'm trying to write a program that find the diameter and radius of a circle if the circumference is entered, and does the same if one of the other two measurements is entered instead. I'm using switch/case …

Member Avatar for Mouche
0
146
Member Avatar for effective

[CODE]You are to design a class class called Employer data members: char name[] long int ID double salary , and two constructors _Default construtor Person () _Copy constructor Person ( char n[30],long int id,double s) _setPerson (char n[30],long int id,double s) that allows user to set information for each person …

Member Avatar for effective
0
141

The End.