Beginners - June 2010 (Page 5)

by fafner
Removing whitespace
 
Im trying to parse user input and remove unnecessary whitespace. This is my code: void parseInput(std::string *in) { for (int i = 0; i < in->length(); i++...
[6 replies] Last: Awesome, the istringstream works;) I'm just curious, because I used an... (by fafner)
by mystar
Copy content between txt files.
 
Hi, I am tryin to copy content from one txt file to another. Find and replace string in this content at one time. I am getting this error, Unhandled exc...
[1 reply] : On this line: line.replace(line.find(" "),6,"RTXApp"); You pro... (by firedraco)
private data passed to non memebr function
 
Hello, Can a private variable declared in a class be visble when passed to a non member function by reference?. I've noticed the member functions are visible wh...
[2 replies] Last: This site also has a section: http://www.cplusplus.com/doc/tutorial/in... (by mcleano)
Class Operators
 
In the first Classes (II) example of C++ tutorial, the code shows an operator being defined (lines 18-23). The example shows one Cvector parameter (Cvector par...
[4 replies] Last: I can't thank you enough for you detailed explanation. Finally unders... (by ravpulp)
by sendjy
undefined reference (again)
 
everything runs properly if i include "vector2.cpp" in my test script undefined reference errors occur if i include vector2.h i have no idea. #ifndef...
[4 replies] Last: Is there another way to hide the implementation then? or do i put bot... (by R0mai)
App won't run on different PC (ntdll.dll)
 
Hi everyone, I'm playing with Visual Studio 2010 C++, and wrote a simple app based on this tutorial: http://lstigile.wordpress.com/2009/05/19/using-libmysq...
[1 reply] : Ouhc, how stupid of me :| there was no "C:\\Server\\MySQL\\share\\eng... (by CableGuy)
by ToniAz
Printing a 2-D arrat
 
Hello everyone! I can't seem to write a function that prints a 2-D array void print(int a , int row, int col) { int i, j; for (i = 0; i < r...
[3 replies] Last: Galik: Could you please provide me with the code, I'm not too good ... (by ToniAz)
C++ code
 
I have a UNIPEN data and I want to read and calculate it. Can any one show me how to convert the data inside the file text to 2d matrix and to calculate the dx ...
[no replies]
Initialization of const array member
 
Can a class contain a const array member, like class A{ public: A(); ~A(); private: const int array ; }; If so, how to initialize it?...
[3 replies] Last: Many thanks! I used static array in my code, but m4ster r0shi really... (by timothyguo)
by paulin
prompt for user input between 0 to 100
 
i want limiting the user input by only key in the mark between 0 to 100. this is my coding: #include <iostream> using namespace std; class Student{ publi...
[1 reply] : Use a loop while getting input from the user - prompt the user for ano... (by bluezor)
Difficulties implementing a struct defined in a class
 
Hello, I am having difficulty attempting to implement a struct defined in a class. I've researched this problem but am still not understanding the invalidity o...
[11 replies] Last: See above: Why the type reference escapes me. The following also... (by eggmatters)
how to read from file
 
hi.. now i'm trying to use openfiledialog to read from file .. first i decalre a cli::array<unsigned char> ^buffer then sent it as a parameter to openfile()-...
[no replies]
reading HEX characters
 
I am trying to read from a HEX file. I am unable to compare a certain characters from the HEX, can anyone tell me what I am doing wrong? if (line == 0x88 &...
[3 replies] Last: You shouldn't use binary file IO and strings together. Here's an exam... (by Null)
Opinion on Coding Practices/Methology
 
Hi all, I am a beginner to C++ who would greatly appreciate a general review of the following code- ie, ways to make it more legible, better implementati...
[10 replies] Last: I'm gonna go ahead and close this thread. Thank you to all who contrib... (by Zero One)
by EEmsu
Finding a certain integer
 
I've been working on this one for a few days and I'm not sure if I'm even in the ball park. Find an integer N such that the sum 1 + 2 + 3 + ... + N is less than...
[3 replies] Last: I would agree with Declan. You need to check sum, not numbers. A coupl... (by Zero One)
how to maintain a database????
 
i just wanted to enter details of some employees and retriving them as required.The following program doesn't have any error.But when i retrive the information...
[4 replies] Last: [quote=anushka]but i want to print only the required one. Oh, ok. Th... (by m4ster r0shi)
by cmccmc
convert a string to a double?
 
How do you convert a string to a double I was looking at http://www.cplusplus.com/reference/clibrary/cstdlib/atof/ but i don't really understand it. I was tryin...
[5 replies] Last: thanks for the help (by cmccmc)
by CAreLo
countdown timer on my quiz game program
 
just as the title says I need help putting a timer on my program and some other improvement, I just started learning C++ so I'm still not familiar with some cod...
[1 reply] : Where wold the timer be placed, waht would it be used for, and what ot... (by C to the UNIT)
increment operator
 
if a=0 b=(++a) + (++a) then b is coming out to be 4. can any1 explain me how??
[5 replies] Last: The parenthesis are meaningless here because the ++ operator has a hig... (by Disch)
by declan
How do I take in a keystroke, but only if there is one?
 
Hey guys. I know this is probably a really simple problem, but I googled it and found things, but nothing that answered this. My main chunk of my program is ...
[5 replies] Last: Here's a post that is what you want. http://www.cplusplus.com/forum... (by jsmith)
June 2010 Pages: 1... 34567... 26
  Archived months: [may2010] [jul2010]

This is an archived page. To post a new message, go to the current page.