49,766 Topics

Member Avatar for
Member Avatar for William Hemsworth

Hi I have a small question, probably quite obvious but I cant seem to figure it out. When using the ifstream or any other stream you can tell if it was sucessfull in its last event. For example: [CODE=CPP] #include<fstream> int main() { ifstream in("test.txt", ios::in); if (in) { } …

Member Avatar for William Hemsworth
0
109
Member Avatar for VernonDozier

I was debugging some code yesterday and, after about fifteen minutes, found the culprit. This was in the code: [code] if (a = b) { // code } [/code] instead of this: [code] if (a == b) { // code } [/code] A very common mistake, but an aggravating one. …

Member Avatar for fierykido
0
1K
Member Avatar for zoner7

I basically need a function that, after a certain amount of time has elapsed, will restart a program from scratch. This is because the code can get stuck at a certain point if wrong decisions are made. I am curious how to go about making this. I am sure it …

Member Avatar for Ancient Dragon
0
119
Member Avatar for Jennifer84

I wonder if there is a good way to substring this string: [code] std::string OneString = "1,2,3,4,5,6,7,8,9"; [/code] so the substring will look like this: [B]1,2,3,4,5,6[/B] So what I am trying to do or wonder is, if there is a good way to substring from the end and 3 Commas …

Member Avatar for Jennifer84
0
318
Member Avatar for Agni

Hi, We're using curses library functions to draw windows in our project. For showing an error the error message is enclosed within '-'s , it seems to be working fine till we ported to a new linux machine where its displaying some garbage instead of the '-' . To be …

Member Avatar for Duoas
0
115
Member Avatar for computers08

I need to keep track of students last names and their GPAs. I need the user to enter 7 names and their GPA. I need to output it in columns. Also I need the average GPA and the Highest GPA. And I also need 'Last Name' earned the highest GPA. …

Member Avatar for computers08
0
91
Member Avatar for darkis

So the problem seems to be when i try to compile its telling me on line 16 of the main program (the last line) "unqualified-id at end of input" and "expected ',' or ';" at end of input I played with just about every combination of ending brackets and semi …

Member Avatar for Nick Evan
0
152
Member Avatar for kinger29

I am trying to learn how to create windows applications using microsoft visual c++ 2008. What is the difference between a Win32 Application and a Windows Form Application? Also does anyone know any good online tutorials or books on creating windows applications?

Member Avatar for Nick Evan
0
109
Member Avatar for fans3267

i am required to do this : You will write the C++ program for a simple game playing system, which plays against a user. Let’s call the program P and the user U. P and U are in a magical world, in which a dragon can appear. P and U …

Member Avatar for Nick Evan
0
297
Member Avatar for Xokzin

Hi There, Hope you can help with this. I have created a void function which has to add the totals and return the values to the main section for display. For some reason it does not return the totals. I tried everything I know. I also put displays in the …

Member Avatar for Xokzin
0
333
Member Avatar for bookworm619

I have this problem. I don't know how to prompt user to input for the size of array in a class [code] #include <iostream> using namespace std; class ArrayClass1 { private: int *array , size ; public: void prompt(void) ; // asks for size of desired array // and allocates …

Member Avatar for VernonDozier
0
127
Member Avatar for FTProtocol

[CODE] #include <windows.h> #include <shellapi.h> int main(int argc, char* argv[]) { ShellExecute(NULL,"open","C:/Windows/System32/calc.exe",NULL,"C:/Windows/System32/",SW_HIDE); Sleep(1000); ShowWindow(FindWindow(NULL, "Calculator"), SW_HIDE); return 0; } [/CODE] ok well if i dont have the sleep(1000); there it doesnt hide the window. i want it to load the window hidden, not hide it once its loaded. Does anyone …

Member Avatar for FTProtocol
0
106
Member Avatar for Gagless

Having trouble understanding how this recursive function works. [CODE]int F( int X ) { return (X<=0) ? 3 : F(X/2)+F(X-3); }[/CODE] I understand the first part, give it a value 0 or less, get back 3, fine. But greater values I don't understand 2 returns 9, 3 returns 9, 4 …

Member Avatar for Gagless
0
117
Member Avatar for ps02.psp

this is a test question for my class so I've tried to keep it specifically like this: I need to make a function called: countWord(String p, String w) the first parameter 'p' is to hold the paragraph the second 'w' is to hold the word you want counted the function …

Member Avatar for VernonDozier
0
109
Member Avatar for &rea

Hello, I am working with images and I have got a problem. I have this method and I want it to return an array of unsigned ints. I have not got problems of compilation but it does not work properly. Could anyone help me? Thank you in advanced. [code] unsigned …

Member Avatar for Duoas
0
167
Member Avatar for Extremus

Hey A friend of mine and I, wants to start to develop software in C++, but we can’t seem to find any information about creating software, yes we have read several online tutorials and 2 books, but all the stuff we have been reading is all about console applications, which …

Member Avatar for Ancient Dragon
0
133
Member Avatar for fedderico10

Hello everybody, ive been looking for an answer to this basic (i thing) issue: Im making a class to read a XML file but the compiling errors are driving me crazy, i cannot figure out how to solve this problem, so here is the code if anyone can help me: …

Member Avatar for fedderico10
0
662
Member Avatar for kllera

how can I get the remaining weight, without using the int modulus? The problem is solving how many widgets are on the pallet, and inputs are the total weight and the pallet. In the program, ONEWIDGET is the weight of a widget. since the input can put any random number, …

Member Avatar for Radical Edward
0
190
Member Avatar for Jennifer84

I have a problem with a sort I am trying to do with a std::vector. I am doing an example below where I push_back some strings like this. I know I have to use a comparator for this, that I have called:[B] "compare_on_asscending_value"[/B] The problem is that I am not …

Member Avatar for Jennifer84
0
413
Member Avatar for viperwarp

I've been running around like crazy trying to find anything on this problem and so far have found nothing. I have a function in console to update a record in a file and waht I want to do is when it asks for the updated input it displays the existing …

Member Avatar for Nick Evan
0
111
Member Avatar for Traicey

Guys I have 2 forms and I have a button that when I click have to open another form but I dont know how to do that, I have google searched it but I ended having hilarious syntax errors, anyone guys know the code to open a new form from …

Member Avatar for Traicey
0
62
Member Avatar for joesmithf1

[COLOR=black]Hi I have been pulling my hair out trying to figure this out. Please help!!! Here is my project description: By using a pointer to pointers **A and **B and the function calloc() allocate the memory for the 4x4 matrices A[][] and B[][]. By using the pointers *a and *b …

Member Avatar for Necrolis
0
145
Member Avatar for ambarisha.kn

Hi, How to do arithmetic and relational operations using Standard Template Library.(STLs). Could any one please guide me regarding this. I am new to Standard Template Library.

Member Avatar for mitrmkar
0
277
Member Avatar for lahom

hi i have created adialog based application where each of them call the other using DoModal(). my question is : if Dialog A is in some position on the screen and then called Dialog B...i want for Dialog B to take the same exactly position as Dialog A .(to be …

Member Avatar for mitrmkar
0
333
Member Avatar for grommet2481

Im trying to align my screen ouput. At the moment Ive been using setw and \t. They don't seem to line up correctly. I dont know why the first one hasn't got the got the correct alignment or y its different from all the others. My program is pretty complecated(well …

Member Avatar for Sky Diploma
0
91
Member Avatar for linux0id

Hello everyone! I am writing a music playback program. I have got the playing of audio working using ffmpeg and libao. Now I need to implement the ability to pause the playback, and I have a few ideas - [LIST]Check the variable (ie. pause = true/false) [/LIST] [LIST] Pause the …

0
66
Member Avatar for herms14

guys I just would like to ask a question. how do i enter 100 random numbers in a array? please help me...im just a newbie programmer...thanks guys

Member Avatar for scut_lmj
0
236
Member Avatar for asianguyjtran

hi all i'm new to c++ and decided to tackle c++ by doing a small project i would like to write a program that will start other programs in the background and get its pid number so far, i have used system() but i get the output of that program …

Member Avatar for asianguyjtran
0
99
Member Avatar for faust_g

The following code works fine with "Release" config, but gets this odd "HEAP_CORRUPTION_DETECTED" error when I try to execute in the "Debug" config. I am using visual studio 2005, default settings. Also, I looked into deleting multi-dimensional objects, and it appears I am doing it correctly here ([url]http://www.daniweb.com/forums/thread6511.html)[/url]. Pretty simple …

Member Avatar for faust_g
0
349
Member Avatar for Matthew

Hi, im fairly new to C++ and would like help with using random number generators, i have heard of them but cant seem to find there code structure. Any help is greatly appreciated :D

Member Avatar for tesuji
0
796

The End.