48,986 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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! | |
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, … | |
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++; } … | |
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. | |
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" … | |
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 … | |
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 … | |
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 | |
[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; … | |
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 , … | |
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. … | |
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 | |
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 … | |
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??? | |
dear sir, i am new to multimedia prog. i am searching for live video streaming c c++. can u help me pls | |
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 … | |
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 << " … | |
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 … | |
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 … | |
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: … | |
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 = … | |
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 … |
The End.