48,986 Topics

Member Avatar for
Member Avatar for ahmed.123

char fileName[100]; cout <<" please enter the name of the data file "<< endl; cin>>fileName; ifile.open(fileName); 1 how to put data in the filename (how to put numbers in the filename e.g lets name it sample.txt where to put this sample to be readen by the program 2. how to …

Member Avatar for pinsickle
0
96
Member Avatar for pinsickle

Hello, I'm working on a problem (Huffman Tree encoding/decoding) and I need to covert and Int to a char. I was trying to use [CODE] char temp = static_cast <char> (index); //index is an integer [/CODE] it compiles but if I try to print, it crashes so obviously that idea …

Member Avatar for jonsca
0
250
Member Avatar for fugnut

I am writing a hangman program for class and so far I am able to read in and randomly pick a word from the file. The problem I am facing is counting the number of letters in the chosen word. Once I get that I can work on the rest …

Member Avatar for jonsca
0
186
Member Avatar for bgx90

I am trying to place a friend function of a template class named sort in its own header file. I keep getting errors when compiling my test program. I have tried different things to fix it, but nothing works. My experience with template classes is limited as is my knowledge …

Member Avatar for bgx90
0
236
Member Avatar for Helpgirl

Hi everyone, i would like to use your help from my programming c++ assignmnet. am trying to do it, and i have to do this assignment because its my last hope to pass the course, because my dr. told me if i didnt do it correctly i will fail so …

Member Avatar for Ancient Dragon
-2
151
Member Avatar for angel19

hi, I have a simple monopoly style board game ready (in c++). I would like to ask you how can I add additional features to the game play such as ‘chance’ cards and ‘shake again’ squares. Is it possible to create a GUI interface for this game too? At the …

Member Avatar for angel19
0
111
Member Avatar for gnarlyskim

Having issues with this program. I've been trying to identify all the areas where data is created, then tried to destroy it likewise after using it. I've put a lot of delete[] coef (coef is a pointer double array to hold coefficients). The program will run half the time, then …

Member Avatar for gnarlyskim
0
125
Member Avatar for Lukezzz

Hello, I am using a button event to activate a backgroundworker that will copy a string to the Clipboard. When debugging the code, I get this error for the Clipboard line in the backgroundworker. I am not sure what this meens or what I need to do here. I have …

0
67
Member Avatar for Lukezzz

Hi, I wonder if there is any syntax that can detect if any Browserwindow is open on the computer and then close this/these windows. I use Firefox and then would want to detect if any Firefox browserwindow is opened and then close them if any is open. Thank you!

Member Avatar for Lukezzz
0
106
Member Avatar for caffeine

In VBA, I create a 3-D array of doubles of dimension (6, 100, 240). The dimensions of the 3-D array is (0 to 5, 1 to 100, 1 to 240). Here is what a VB watch of the 3-D array looks like: [CODE]ir Variant/Variant(0 to 5) ir(0) Variant/Variant(1 to 100, …

0
69
Member Avatar for fugnut

what AmI missing? I am simply trying to read in an array from a txt file and count the words. What am I doing wrong....here is the function[CODE]int countwords(ifstream& infile, int wordcount[MAX_WORDS]) { int count = 0; for( int i=0; i < MAX_WORDS && infile; i++) { infile>>wordcount[i]; count++; } …

Member Avatar for Ancient Dragon
0
83
Member Avatar for masumeh--

hello i calculated the run time of my program by clock instruction but when i run the program for one input in several times, the run time of program is different from previous.

Member Avatar for Ancient Dragon
0
47
Member Avatar for Blue$kull

I found a tutorial of how to link object files: I have 3 different files. [B]main.c[/B] [code=c] #include<stdio.h> #include"reciprocal.hpp" int main (int argc, char **argv) { int i; i = atoi (argv[1]); printf ("The reciprocal of %d is %g\n", i, reciprocal (i)); return 0; } [/code] [B]reciprocal.cpp[/B] [code] #include<cassert> #include"reciprocal.hpp" …

Member Avatar for Blue$kull
0
386
Member Avatar for modesto916

Good Afternoon, I am from brasil, and i am beginning to study programming, I bought the book "C++ How To Program", and i am now trying to make a small software with each class in its file, with prototypes and etc, here is a simple program that i made to …

Member Avatar for modesto916
0
168
Member Avatar for imunk123

When you read a long document, there is a good chance that many words occur multiple times. Instead of storing each word, it may be beneficial to only store unique words. Write a program that implements this strategy. Read a word at a time from cin. Keep a vector<char*> of …

Member Avatar for WaltP
-1
102
Member Avatar for jonymanolo

is posible expalin my for what use %s in a code line [CODE]cmdLine.Format("\"%s\" \"%s\" %d %s %s %s", playerFile, moviePath, 10, cameraName, selectDate, movieID);[/CODE] i need now how works this code line

Member Avatar for tetron
0
86
Member Avatar for vivosmith

[code=C++]#include (iostream.hpp) class Stocks { public: Stocks( int price); ~Stocks(); int get_price() const {return pps;} int set_price() const {pps;} int the_price_is (int pps); int pps; } int main() { Stocks AMX (35) cout << " Hello, please enter a symbol.\n"; if cin>> AMX; cin.ignore; cin.get; AMX.the_price_is cout<<" 35.\n"; return 0; …

Member Avatar for Fbody
0
115
Member Avatar for vbx_wx

can someone help me ,i am trying to enumarate some registry keys,i doesnt get me any error,just the output is wrong: [CODE] void Registry::open_key(HKEY Key , char* subkey) { RegOpenKeyEx(Key , subkey , 0 , KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE , &hkey); } void Registry::querry_info_key() { RegQueryInfoKey(hkey , 0 , 0 , …

Member Avatar for vbx_wx
0
436
Member Avatar for thriek

Hey, im in need of a little help... im trying to have my .exe show an image with sdl, wait 2500 milliseconds, close the image and then return to the black console screen with my cout statments and whatnot appearing. But instead when i exit sdl, the whole program exits. …

Member Avatar for thriek
0
396
Member Avatar for cotinga

i am new in c++ programming language,i do not understand very well imprementation of linked list,can u help me by providing me algorithme for it

Member Avatar for Nick Evan
0
127
Member Avatar for eggberto

I've just read a few books on C++ and learned a lot about the language, but the books never mentioned how to add sound and visuals to my programs. I "think" that stuff is all stored in libraries, but... what tutorial should I read next to learn how to implement …

Member Avatar for WaltP
1
199
Member Avatar for Ali Gohar

i want to make this game....and i need help....in the game computer should play as a second player....and it should also win....is that possible....and is it easy???

Member Avatar for WaltP
0
51
Member Avatar for vasante80

dear sir, i am new to multimedia prog. i am searching for live video streaming c c++. can u help me pls

-1
28
Member Avatar for tallygal

I have to utilize an array for a homework project. I want it to read a line from a file on my hard drive. However, the line starts with words and ends with numbers. I only need to utilize the numbers for a function that I want to pass a …

Member Avatar for WaltP
0
204
Member Avatar for nahmartin

Hello Most of my C++ is self taught so please excuse me In my code I am writing a large amount of data to file [CODE] for(int i=0; i<itr_atoms; i++) file_out << i+1 << " 1 " << atoms[i][0] + origin_x << " " << atoms[i][1] + origin_y << " …

Member Avatar for nahmartin
0
187
Member Avatar for 3cats

I posted last night with this question and I didn't include the coding (DUH). I am getting the error " error C2143: syntax error : missing ';' before '{' 1>c:\documents and settings\user\desktop\c++ programming\midterm2invoice\midterm2invoice\midterm2_invoice.cpp(68) : error C3861: 'While': identifier not found" Here is the code, everything works until it gets to …

Member Avatar for 3cats
-2
149
Member Avatar for satimis

Hi folks, Just join this forum. I, a beginner on C++, have been googling around for tutorial to learn C++ in Linux platform. I found following tutorial; Teach Yourself C++ in 21 Days [url]http://newdata.box.sk/bx/c/[/url] I suppose it is for Windows. Can I use it on Linux? I'll use g++ as …

Member Avatar for satimis
0
123
Member Avatar for vbx_wx

i never used enum before now,but what could be wrong in this definition ? [CODE] enum keys { HKEY_CLASSES_ROOT , HKEY_CURRENT_USER , HKEY_LOCAL_MACHINE , HKEY_USERS , HKEY_CURRENT_CONFIG }; .\src\av.cpp:28: error: expected identifier before '(' token ..\src\av.cpp:28: error: expected `}' before '(' token ..\src\av.cpp:28: error: expected `)' before numeric constant ..\src\av.cpp:29: …

Member Avatar for Banfa
-1
89
Member Avatar for merse

I have an enum type, for example: [CODE]enum signum {negative = -1, positive = 1, zero = 0, inward = -1, outward = 1, indefinite = 2}; [/CODE] I want to use at least one of the following castings: [CODE]signum s = positive; double x,y; x = double(s); y = …

Member Avatar for Narue
0
2K
Member Avatar for kevintse

Hello, everyone. I have a question to ask. According to The C++ Programming Language (3rd. Ed.) by Bjarne Stroustrup on page 405: "Members declared [COLOR="Red"][B]protected[/B][/COLOR]are far more open to abuse than members declared [COLOR="red"][B]private[/B][/COLOR] . In particular, declaring data members protected is usually a design error. Placing significant amounts of …

Member Avatar for kevintse
0
1K

The End.