49,756 Topics

Member Avatar for
Member Avatar for coding101

why cant i use fstream on mac i have a stuff.txt file one the desktop psuedo #include<fstream> ifstream in; ofstream out; in.open("stuff.txt"); if(in.fail()){ cout<<"failed"; } failing WHY???

Member Avatar for coding101
0
62
Member Avatar for bigwhiteegg

the following are my program since it's not large, it might be alright to post the entire code? anyway... it is the deallocate() causing the crash at the end of the program for some reason, it did not panic in the grow() function am I supposed to do something after …

Member Avatar for Ancient Dragon
0
133
Member Avatar for jpetrey

i am reading in data from an input file and sorting it as it comes in. (ive done this before just without sorting so i know everything else works fine.) [code=c] StringTable::StringTable(ifstream & infile) { // TODO: complete string s; vector<string> row; vector< vector<string> >::iterator srow = table.begin(); vector< vector<string> …

Member Avatar for Ancient Dragon
0
954
Member Avatar for cortez716

If you are viewing my post, thank you for taking the time to hep me out. It is greatly appreciated. Here is what I'm trying to do: Write a function called Square2 that will take as arguments an integer and a double. With the use of references i want my …

Member Avatar for cortez716
0
162
Member Avatar for Urv73

Hi, I'm trying to make a program that lets a user punch in the results from a race. What I got is a loop for entering the contestants startnumber, the time they started the race (hh, mm, ss) and when they finished the race (hh, mm, ss). I'm stuck with …

Member Avatar for Urv73
0
186
Member Avatar for ezkonekgal

i'd like to ask if to is calculate the turn around time of a particular process is: turn around time = burst time - arrival time ?? and what about response time and waiting time? like in a preemptive scheduling where a process is preempt when a new process enters …

-1
103
Member Avatar for tKc

I need help in reading a text file and by using a switch statement the user can either press 1 to find the average of all the integers in the text file, and by pressing 2 they find only the averages of the real numbers (only positive integers) in said …

Member Avatar for Ancient Dragon
0
470
Member Avatar for vbx_wx

How can i calculate an expresion of type string: [code] strng eval = "129 + 23 - 54 * 2 / 4"; [/code] Any ideas?

Member Avatar for bunnyboy
0
90
Member Avatar for Blitze

Hello, I used to code in python and I recall being able to take a class such as the list class and add my own functions to it. I am not quite sure what this is called in c++ or how to do it, so I was just wondering if …

Member Avatar for Blitze
0
94
Member Avatar for RobBobSmith

Hello all, I would be grateful for some help with a function template problem. I cannot figure out how to pass a matrix as an argument in a template function. I keep getting the error "does not match any template declaration". Can anyone suggest what my problem is? Have I …

Member Avatar for Fbody
0
183
Member Avatar for LevyDee

[code] MonthNames[0] = "Januaray"; MonthNames[1] = "Febuary"; MonthNames[2] = "March"; MonthNames[3] = "April"; MonthNames[4] = "May"; MonthNames[5] = "June"; MonthNames[6] = "July"; MonthNames[7] = "August"; MonthNames[8] = "September"; MonthNames[9] = "October"; MonthNames[10] = "November"; MonthNames[11] = "December"; for(int n = 0; n < 12; n++) { cout << MonthNames[n] << …

Member Avatar for Fbody
0
112
Member Avatar for Blitze

Hello, I am in Object Oriented Design for C++ at the moment... The test we are having has a question on it and the professor wants us to find and know the answer before we come in for the test. The question is this: The following code out puts what …

Member Avatar for Blitze
0
130
Member Avatar for jeffcogswell

[ATTACH=left]17191[/ATTACH]Today at Intel's IDF 2010 was the official launch of the 2011 version of Intel Parallel Studio. Parallel Studio is a set of tools that enhance Visual Studio to support full parallel programming. This is more than just a simple plug-in for Visual Studio. It's an entire set of tools …

Member Avatar for jeffcogswell
5
311
Member Avatar for NordCoder

Hi Daniweb, I doing an assignment for a course I'm taking at my university. The assignment involves using the Boost Graph Library (version 1.43). So far, I haven't had any trouble at all. Then I tried calling dijkstra_shortest_paths(...). The named parameters way of calling this function does not work in …

0
72
Member Avatar for pstrohma

Hello all, Does VC++ Express 10.0 even support the ability to get text from a text box? I've seen related threads having conflicting solutions, none of which actually work. Ex: must have SDK version x.y. This functionality seems to be so basic and necessary that solutions would be all over …

Member Avatar for pstrohma
0
260
Member Avatar for manny c++

:cool: Hi all I have fingered out how to check the users input for their first and last name This works fine. If the user enters a number for their name they resave an error message. But it only works for the first letter How do I increment the check …

Member Avatar for Alexkid
0
421
Member Avatar for malvi

Hello.. I want to block/disable each and every message box, generated by system. ie. Edit box is numeric, and when it is empty, it will generate error box, "Enter a number". can anyone help me in this? Thanks.

Member Avatar for MrSpigot
0
167
Member Avatar for bmos31

I'm trying to write a program that prints out Euler's triangle as follows: 1 1 1,1 1,4,1 1,11,11,1 1,26,66,26,1 1,57,302,302,57,1 1,120,1191,2416,1191,120,1 It uses the following formula, where A is a vector of vectors: A[x][y] = (x-y)A[n-1][m-1]+(m+1)A[n-1][m] I've already implemented the formula to the function I've created to printEulersTriangle(), but it …

0
88
Member Avatar for Alexkid

Hi there, Can anyone tell me why variables can have printed values of -858993460. I've got a pointer pointing to a memory address which has nothing in it so when i come to cout this it prints -858993460, if i give it a value then its prints that value. I …

Member Avatar for Alexkid
0
2K
Member Avatar for hzp

hello everyone i am new to this community . i am having a problem right now with arrays. So basically this program let user to enter anything in lowercase and then convert it to uppercase(if user input uppercase it will stay the same). Because i am not allowed to use …

Member Avatar for hzp
0
123
Member Avatar for uspanday

hi, I have many images. Per image, I have a set of lines called wireframe and every wireframe has many other lines extracted from images. I want to create a data stucture to store Image-Wireframe-Ext_lines Triplet. I am not getting any error but output is not expected. Can anyone help …

0
47
Member Avatar for ranko_6

Trying to write a simple program that will read data but keep stumbling upon the fact that I kinda can't limit the amount that is read. I have simple student.dat file which is filled ATM with nothing else but simple string "somethinginside", without quotes. When I do this on each …

Member Avatar for ranko_6
0
203
Member Avatar for DonutsnCode

I'm using cygwin g++ to compile my code and Notepad++ as my editor. The code i authored works fine if i implement member functions in the class definition .h file. However g++ throws a chunk of gibberish at me when i replace member functions with function prototypes in the class …

Member Avatar for DonutsnCode
0
126
Member Avatar for samsons17

Hi.. I am trying doing this exercise.Which is require a program that could ask the user how many integer he/she want to enter,and allow him/her entering them thus lastly display them all back. i could just simply doing it by using an array,but this time i wanna use a vector …

Member Avatar for Narue
0
121
Member Avatar for stereomatching

I am using the library of boost to create a 2D dimensions array and compare about their speed There are three kinds of array, matrix of boost, multi_array of boost and the raw array Below is my code: [code] #ifndef TESTRELMAT_H #define TESTRELMAT_H #define BOOST_NO_EXCEPTIONS #define BOOST_DISABLE_ASSERTS #include <boost/numeric/ublas/matrix.hpp> #include …

Member Avatar for Narue
0
140
Member Avatar for Varnius

I started learning Winsock (2.2) programming in university recently and when writing my first program (fileserver and its client) a few questions came to mind. Let`s assume my fileserver is continuously listening for client connections and when one occurs it establishes connection, does whatever client wants (such things as list …

0
119
Member Avatar for moonL!ght

hi every one im working with some exersies which include inheretence every thing is fine except that the compiler dose not recognize the base clase it says Error [COLOR="Red"] Cannot open include file: 'pointType.h': No such file or directory[/COLOR] here is part of the code [CODE] # include "pointType.h" # …

Member Avatar for chiwawa10
0
128
Member Avatar for bbman

alright, I'm a bit stuck here, I've tried a few things but I can't figure it out. Question is in the source: [code=c++] // test.h namespace test { class foo { static void test(); }; } [/code] [code=c++] // test.cpp #include "test.h" namespace test { // how can I define …

Member Avatar for bbman
0
132
Member Avatar for XMasterrrr

like the thread title said i need the best C book for never programmed person can you please tell me it thanks....

Member Avatar for elsiekins
0
169
Member Avatar for Christ1m

The book Im using. Pg 108 - 124 Objects Abstraction, Data Structures and Design using C++ Author: Elliot Koffman and Paul Wolfgang I have a problem with this code. All of these errors are occurring in the Phone_Directory.cpp. It is in, getline, << , out. .......functions... I tried getting these …

Member Avatar for Intrade
0
211

The End.