General C++ Programming - April 2010 (Page 13)

operating with utf8 strings in C/C++
 
People, hopefully there are (enough) simple answers: in what ways should utf8 strings be handled in C? And C++? And what about wide chars -- what real applicat...
[3 replies] Last: That is true of any multi-byte encoding. It is not an error in the for... (by Duthomhas)
Output, input/output, and averages
 
Needs to output first 100 prime numbers. #include <iostream> using namespace std; int main() { int prime = 2; int coun...
[3 replies] Last: I'm not good at understanding other's code, anyways I have some of min... (by denis90)
difference between two vectors in c++
 
Hello. I'd like to ask you guys a question about vectors: I'm trying to extract the difference between 2 vectors, but so far I've been unable to do it. I'm post...
[7 replies] Last: serge, It works, thank you very much for your help. kempofighter, y... (by doppelgangland)
Copy Constructors and Inheritance
 
I have a bit of a conundrum: If have a base class with a properly defined (deep-)copy constructor, and I derive from that class and the only new member variabl...
[4 replies] Last: sweet, now I know for sure. That's what I thought happened, I just wa... (by closed account 1yR4jE8b)
by everid
STL container adapter questions
 
stack queue priority_queue when the empty() yields true, is the memory really zero? i didn't find capacity() for these containers, so how to release the m...
[2 replies] Last: Thank you very much. because sometimes, i use queue for breadth first... (by everid)
Game
 
Hi, Im making a game and am having problems with a couple of things. First off I need to read my env from a txt file. My environment is a 2d array. I know i a...
[1 reply] : Could you post the code that you have now and also the text file? It ... (by pasukon)
Get max value from numbers in text file
 
Hi folks. I have a text file with a thousands of rows of numbers in it. For example: 1 2 4 6 11 13 19 21 66 97 101 ........ 1 3 9 12 18 26 44 56 98 113....
[7 replies] Last: It's ok, I've sorted it. Thanks for your help. (by james890)
List of lists
 
Hi I'm writing a program that has an object of lists and a list of that object type. I'm having difficulty figuring out how to load the data into the list of l...
[4 replies] Last: You're passing lists by value to the helper functions. (by kbw)
by RET80
3D models and C++
 
Hello folks, So I'm looking into using 3D modeling to do some basic game design, however I have no idea where to begin with this concept. I can export mod...
[2 replies] Last: Thanks Albatross! They both look great to tweak, how would someone ... (by RET80)
print word have length n
 
i have string i want to print word has lengh is n ex char *s="hello ! thank you" n=5 print : 'hello' and 'thank'
[1 reply] : well, I thin you could use strtok ( http://www.cplusplus.com/reference... (by hamsterman)
quick question about the this function
 
class CDummy { public: int isitme (CDummy& param); }; int isitme (CDummy& param); so is this function is meant to take in the class(CDummy)'s obj...
[2 replies] Last: ah i see...i was just wondering whats it really meant to do n is it re... (by jinkazama99)
C++ Collision detection in games programming...
 
I am creating a scrolling game in which a player controls a submarine, i need to check whether the sub has collided with objects. How would i acheive this? ...
[2 replies] Last: Do you mean collision with the background (which is scrolling), or for... (by choisum)
by omgaga
Find the mistake.
 
Ok, i've wrote the code. But i can't find the mistake i've done. Can somebody please help me... #include<iostream> #include<iomanip> using namespace std; v...
[8 replies] Last: Should line 25 be: sceduleanna (annaarray); ? (by millionsteve)
copying 2 arrays into one array
 
Hi, I have the following requirement. I have a array b = "MP 2 "; I have a array location = "X +1.2345" and location1 = "Y +3.4567". Now , I have to...
[3 replies] Last: You can use strings instead of arrays: http://www.cplusplus.com/refe... (by Bazzy)
function to count words
 
we are working with threads, and have to write a program that counts the number of words in an arbitrary number of files, one thread per file. The thread part ...
[2 replies] Last: Present version of count_words counts number of fragments separated ... (by serge)
how to put an array to an class pointer variable
 
Vector<double>* rhs = new Vector<double>(ndata); c ={0,1,2,3,1,2,1,2,1} (*rhs)=c; the method is wrong, can you help me?
[1 reply] : Why are you using a pointer to vector? http://www.cplusplus.com/refer... (by Bazzy)
by wrz234
cout
 
is cout means for printf? because i am a new learner for C++ and having touch on this 'cout'. i seen one like cout << end1; what is that about? a ...
[9 replies] Last: how to c program cout is only available in C++, but it is general... (by imi)
Have no idea what to do here.
 
// Implement the sumOfDigits() function (see below) so that the following // code will work properly. // Declare an integer for input and the sumOf...
[3 replies] Last: I think you are asking the definition of sumOfDigits(int) function... ... (by ankitsingh12)
what is function call as Lvalue
 
Hi, In C++, we can use function calls on L value (left side of assignment operator) where the function returns non-const reference object. It looks something ...
[4 replies] Last: assigning the R value(1) to the return object of the function f(). In... (by helios)
Linked list
 
Hey guys I am trying to do the following. 2. Create a structure called ListNode that can hold an object of the car class as its value. 3. Create a Linked Li...
[17 replies] Last: I really need help guys I want to get this stupid thing done I am so f... (by tarheelfan08)
April 2010 Pages: 1... 1112131415... 24
  Archived months: [mar2010] [may2010]

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