51,593 Topics

Member Avatar for
Member Avatar for duke.tim

okay so I am having an error with the code below and don't really know how to fix it, according to what I've looked up it should be right. I am using g++ on a linux system. (P.S. i'm a newbie ) okay and the error is: random.cpp: In function …

Member Avatar for duke.tim
0
718
Member Avatar for Jfunch

I'm suppose to write a program that asks the user to enters numbers which will be stored in a dynamic array. Then once they enter their first set of numbers they are asked whether they would like to enter another number or remove a number from their list. You can …

Member Avatar for tetron
0
148
Member Avatar for hellskier

Hello, I have a little program that needs to get data from two separate .csv files for afterwards parse them and translate info to vectors. Everything works fine when I am working with just one file (so just one ifstream), but when I try to use another ifstream to read …

Member Avatar for hellskier
0
178
Member Avatar for mks200

ok im kinda stuck in this homework, i dont know where to go next, please help me i need this done soon! heres the problem Your swim school has two swimming instructors, Jeff and Anna. Their current schedules are shown below. An "X" denotes a one-hour time slot that is …

Member Avatar for thomas_naveen
0
420
Member Avatar for close_encounter

I'm brand new to C++ and I'm having a difficult time. I'm working on a project for school and I'm very confused with functions all together. How do I get my arrays from main so I don't have to have them in each function and how do I call each …

Member Avatar for Banfa
0
146
Member Avatar for zemly

Hello, I have to make this programe. Please I need some tips and help to accomplish my objective. Please give a sample sketch. Must guide me.... [U][B]Problem Statement: Exchange of currency rates[/B][/U] You are required to write a program for Currency Exchange rates. User will have three options i.e. Pakistani …

Member Avatar for jwenting
-2
107
Member Avatar for red999

After tackling with this function for almost the whole day, I still cannot figure out why this code isn't working. My BTNode has three pointers(left, right, and parent). I went through this code on paper and it seems to work fine, but it does not work fine during execution. I …

Member Avatar for red999
0
130
Member Avatar for cproud21

I have created the following code to act as a buffer between two threads. I am trying to add support to handle empty and or full buffers, and am not sure how to address this. Would it be done through condition variables? Thanks. [CODE]#include <stdio.h> #include <pthread.h> #include <unistd.h> //for …

Member Avatar for vijayan121
0
239
Member Avatar for kodera

This is just the beginning of my name sort prog... I am starting with just reading in the names and then outputting each name... As of right now, it is crashing after displaying the first name... I think it's something with my array.. rectangular, instead of square, but don't know …

Member Avatar for jonsca
0
71
Member Avatar for timbomo

I cant seem to figure out why this program wont write to a .txt I commented out the meaning of each step and it looks like i am doing everything correct. If i can get it to write it and goto the following steps. [CODE] float price,curr_total=0.0; int itemnum, wrong=0; …

Member Avatar for VernonDozier
0
137
Member Avatar for timbomo

[QUOTE]in the files in_stream2 and 4 they wont open correctly but the rest of them will and i cant move forward until i fix it. i dont even no where to start when trying to fix it could someone help?[/QUOTE] [CODE]ifstream in_stream; // reads itemlist.txt ofstream out_stream1; // writes in …

Member Avatar for timbomo
0
122
Member Avatar for Danny_501

Hi all, i am trying to get an address from a user but when the program gets to the street i have an issue where the intended input i would like is: "big St" but this causes the cin /getline function(have tried both) to write it into the next input …

Member Avatar for Danny_501
0
86
Member Avatar for Hidden_mistakes

Hi i am trying to create a racing game and at the moment i have keyboard input which moves the player around at the same continous speed. I am wanting it to speed the player up however the longer you hold the key down for. Any simple way i can …

Member Avatar for Hidden_mistakes
0
109
Member Avatar for xcarbonx

Hello, i am currently working on a grade program that displays the student name, id #, and 2 grades. I have to read each of these categories off of an input file which should look like the following for at least 20 students.: EX: Jack Smith 450654333 95 89 The …

Member Avatar for xcarbonx
0
128
Member Avatar for ahmed hefnawy

How can i make user enter any numbers and can make all operation on them and provide him with() like: (9+3)/(-3*4) i wanna a solution please thanks

Member Avatar for Ancient Dragon
-1
75
Member Avatar for Elenaser

Hello, I am currently trying to write a program that will display a chart for the inventory of a car dealer. Here are the major points of the assignment, the ones Im having trouble on: Write a program to be able to display the instock table as instructed below : …

Member Avatar for Elenaser
0
192
Member Avatar for crodriguez08

Hey, I'm pretty much almost done with this program, but I'm not sure how to clear a previous file (after opening it) in order to open a new one. My program is supposed to open a file with a maximum of 100 unordered decimals and allow the user to sort …

Member Avatar for crodriguez08
0
107
Member Avatar for collinisaac

ok heres what i got [CODE]Main.cpp System::Void Form1::button1_Click(System::Object^ sender, System::EventArgs^ e) { SetText("Hello, it's working"); } System::Void Form1::SetText(String^ strText) { this->textBox1->Text = strText;[/CODE] form1.h [CODE]private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e); private: System::Void SetText(String^ strText); [/CODE] What if I want to display the results of type double variables or int variables …

Member Avatar for jonsca
0
113
Member Avatar for goldstmarc

Hi, I just want to say i've been searching around this forum and have seen things about GMP and precision arithmetic (which im reading now). However, i've seen nothing to the extreme of a number that I need. This is an *extremely* large number. Before I even get into the …

Member Avatar for NathanOliver
0
192
Member Avatar for Hidden_mistakes

I am wondering why the right hand side of my split screen isn't in the middle and also why the game goes off of the background, any help would be much appreciated [code] #include "SDL.h" #include <stdlib.h> #include <stdio.h> #include <stdlib.h> #include <Windows.h> #pragma comment(lib,"Winmm.lib") /* ---------------------------------------------------------------------- */ /* Defines/Enumerations …

Member Avatar for Hidden_mistakes
0
108
Member Avatar for gregarion

Hey guyy , using getline allows us to read a file line by line. but is it possible to use getline to read individual words in a line? For example. Test.txt My name is John. Using getline will read the entire line... [CODE] int main (){ string templine; ifstream myfile("test.txt"); …

Member Avatar for NathanOliver
0
143
Member Avatar for Dinglish

I am new to programming and i am teaching myself. (my teachers are not very good) I am attempting an old assignment that a colleage had completed in school. He told me it was pretty basic in terms of c++ programming. UELS is a company selling bicycles; Customers may opt …

Member Avatar for NathanOliver
0
118
Member Avatar for mebob

Hey, i was wondering if there was a way to output really large decimals, either to a file or to the output stream? because when i do this: [CODE] file << setiosflags(ios::showpoint) << setiosflags(ios::fixed) << setprecision(50); [/CODE] or do that with cout, the program crashes.

Member Avatar for DinoBA
0
106
Member Avatar for kingnebula

Greetings, I am having an issue with calling both winsock and winsock2 libraries but i can't seem to find where i have called winsock from. I have a main.cpp calling a Socket.h main.cpp contains the following includes: [code] #include "stdafx.h" #include <iostream> #include <vector> #include <windows.h> #include <windowsx.h> #include <string> …

Member Avatar for Ancient Dragon
0
277
Member Avatar for Avatar99

My overloaded operator isn't initializing the value passed through it. Please help!!! and yes I am aware that my insert function isn't complete... [CODE=c]#include <iostream> using namespace std; struct Node{ int value; Node * next; }; class linkedList { public: linkedList () {first=0; length=0;} bool operator > (int a) ; …

Member Avatar for Sky Diploma
0
111
Member Avatar for summey

The code below is for my assignment it works i just want to make sure i did this correct any advice is wanted. Also one thing that is bugging me see basepay well if the base pay is 133.20 it chops off the 0 and only displays 133.2 why iv …

Member Avatar for summey
0
132
Member Avatar for gregarion

Hey guys i need a bit of help in getting my answer correct. Basically , im trying to get my answer to 2 decimal places when i divide one number by another... [CODE]int main(){ int Totalgpa = 46; int e = 13; int SemesterGpa = Totalgpa / e ; cout …

Member Avatar for Avatar99
0
83
Member Avatar for gregarion

Hey guys , i am trying to write an array into a textfile. Here is the coding... [CODE]int main() { ofstream myfile("report.txt"); int g = 0; int billy [] = {16, 2, 77, 40, 12071}; for (int n=0 ; n<5 ; n++ ) { g = billy[n]; myfile << g …

Member Avatar for Fbody
0
110
Member Avatar for samoz83

I'm was wondering if it is possible to be able to import numbers from a file into an array, if the file was set out as: Jan 03 Feb 10 Mar 13 Could you discard the characters and just import the numbers?

Member Avatar for Fbody
0
86
Member Avatar for jessiko555

Hi I've made a program but for some reason I am getting this error that I can't even begin to decipher because it won't point me to where the error has been made. I am using the PV=ZnRT formula. Here is the error: 1>C:\Users\user\Documents\Visual Studio 2008\Projects\lab24jess\Debug\lab24jess.exe : fatal error LNK1120: …

Member Avatar for jessiko555
0
245
Member Avatar for tianxieng

Plesese help: i have no ideas to do with this problem. Write a program which allows the user to input several real numbers and then prints out the 2nd smallest number. The input sequence starts with a positive integer indicating the number of real numbers. For example, for the input …

Member Avatar for Salem
0
153
Member Avatar for krishnisilva

hi, Question 1 i am developing a project in C#.Net, and when a form loads data from the SQL client database is added to four combo boxes in the form, i need to change the data in the combo box when the check box is ticked. I wrote a code …

Member Avatar for gusano79
0
172
Member Avatar for Masterslay23

hello guys.. i need your help..can anyone help me to solve my problem... i want to create login password in C++.. please someone help me

Member Avatar for daviddoria
0
51
Member Avatar for Mattan360

Hi! (This is my first post on the forum) I'm trying to capture the desktop of the "not showing" desktop. I got two users, both logged in. I start the program on the first users desktop (to capture), and then the second one on the other user, which is supposed …

Member Avatar for Mattan360
0
234
Member Avatar for smackdown164

so my project is due tomarrow and im stuck i need to some help. This is what i have it came up with some errors and i need to finish it. The conditions are TOTAL BALANCE and need to withdraw only multipule of 20 [CODE]// This is a program that …

Member Avatar for lakarr
0
616
Member Avatar for JwhateverJ

I have this program where I'm trying to find the file size with the boost library. I find the files fine, but it won't get the file's size, where am I wrong? Thanx for your help... Here's my code so far. It compiles fine, but won't return the file size. …

Member Avatar for JwhateverJ
0
4K
Member Avatar for Loranus

Hello for my C++ programming class I am programming a Dictionary program that allows the user to enter in definitions and stores them between 2 classes. Dictionary which will contain all my entries and Entry which will contain the definition for every word that the user inputs. Now when they …

Member Avatar for mattjbond
0
109
Member Avatar for n.utiu

I am working at a project that is supposed to run a python script. Here is my main class: [CODE] #include <iostream> #include "scripting.hpp" int main(void) { cScripter oScripter; std::vector <double> vectMy (7, 32); oScripter.doRunScript (&vectMy, "test.py", "function"); return 0; } [/CODE] And here are respectively scripter.hpp and scripter.cpp : …

Member Avatar for n.utiu
0
151
Member Avatar for nahmartin

I am having problems with sending my array N_List [CODE]int** N_List = create_2d_int_array(len_N_List, 100, "voro:N_List"); double** atoms = create_2d_double_array((int) (8*box_x*box_y*box_z/(lattice*lattice*lattice)), 3, "voro:atoms"); for(i=0;i<len_N_List; i++) for(j=0;j<100;j++) N_List[i][j] = 0; [/CODE] The code runs fine with N_list send and recv omitted but with it, it causes a segmentation fault Send [CODE] if(rank …

Member Avatar for nahmartin
0
469
Member Avatar for manojkv

hi i am new to VC++ ,i want to read a .txt file and parse line by line and interpret the data on windows console ,can any one help me in this regard plz.. thanks in advance

Member Avatar for daviddoria
0
83
Member Avatar for maddav

Hi, Recently (today) got an assignment to take a particular code that we've done previously, and split it into 3 files: 2 .cpp files and a header file. Now, i believe i've done it correctly, but the only thing that's throwing up errors is the use of friend for overloading …

Member Avatar for maddav
0
3K
Member Avatar for FlynnLags

This is quite literally driving me insane. I'm new to C++ so bear with me on this one. Basically, I've got two files. One header file (Package.h) and the C++ file (Package.cpp) I've got a class called [B]Package[/B] and function prototype in the header file as follows [CODE] private: string …

Member Avatar for Fbody
0
803
Member Avatar for Danny_501

Hi all, I have a file called Client.cpp, which has main() contained in it. my problem is at the start of the file: [CODE]#include <iostream> using namespace std; #include "Student.h" enum User { NO_USER = 0, STUDENT = 1, ADMIN = 2}; [/CODE] I get errors on the line with …

Member Avatar for Danny_501
0
126
Member Avatar for FlynnLags

Hey guys, After fixing one of my earlier problems I ran into another one. Basically I'm trying to make an inherited class and add one more parameter to its constructor, but I can't seem to do it properly Here is the masterclass definition [B]Package[/B] [CODE]#ifndef PACKAGE_H #define PACKAGE_H #include <string> …

Member Avatar for FlynnLags
0
204
Member Avatar for godflesh231

If I wanted to access a function that is in a derived class from it's base class, what would be the best way of doing so? I have experimented with functions like [icode]Interact( char *pCommand, char **pArgs )[/icode] which is inside the base class, and can be overidden by the …

Member Avatar for jwenting
0
142
Member Avatar for atticusr5

Ok so I am a total newbie, and for our last programing assignment in my class we are going over Binary Search Trees. Out assignment is to take an older program and make it into a binary search tree. I am using Visual Studio and I have gotten past all …

Member Avatar for mattjbond
0
1K
Member Avatar for gufur

Hi! I just upgraded to win 7 64 bit. I have tryed it both on cygwin compiler and MinGW compiler (toolchain) Working on eclipse. My code works perfect in Linux/ubuntu environment but running in win 7 environment I have the following problem. My last cin does not work. The input …

Member Avatar for gufur
0
402
Member Avatar for loadload

[CODE] using namespace std; int main(int argc, char *argv[]) { int item_weight; // ITEM WEIGHT IN GRAMS double item_unit_price; //ITEM UNIT PRICE ($) int quantity_required; // QUANTITY REQUIRED //ENTER ITEM WEIGHT IN GRAMS----------------------------------------------------- cout << "ENTER ITEM WEIGHT IN GRAMS: "; // prompt for input item_weight cin >> item_weight; // …

Member Avatar for loadload
0
133
Member Avatar for smackdown164

Im have trouble complete on what i have. Looking for some idea's I'm getting a exit error and don't know what to do? Please Help [CODE]// This is a program that is an ATM. #include <iostream> #include <cstdlib> #include <iomanip> using namespace std; void welcome(); void menu(); void amountDeposit (); …

Member Avatar for Nick Evan
1
182
Member Avatar for monkey_king

I'm having difficulties understanding and printing the max value of a size_t type. Apparantly the size_t is typedefed to a unsigned long int on my system. Is this safe to assume its the same on all c++ compilers? The 'sizeof' function returns the number of bytes(size char), used to represent …

Member Avatar for idallen
0
1K

The End.