General C++ Programming - November 2009 (Page 10)

getline from a matrix
 
Hello there, I want to know how can I use the line from a matrix as the source for a getline function. I have a matrix that stores several web pages. Each l...
[6 replies] Last: I imagine v is a matrix, and v gets the i-th string in it. If this is... (by Zhuge)
Assignment with classes
 
Can you please find errors my program for minesweaper in which I needed to use classes.Here it is: #include<ctime> #include<iostream> #include<cstdlib> usin...
[5 replies] Last: This is a problem too: if (x,y<=8) (by jsmith)
problem with ofstream?
 
The code I have a problem with has been shortened so that only the relevant part is in this message. I have a problem with this code in that the value for heigh...
[1 reply] : These are all assignments, not comparisons: if ( (height =heigh... (by jsmith)
Reverse elements in a Queue Problem
 
Hello, I need help reversing elements in a queue using Recursion. My problem is that when I print out the reverse, it does not show the numbers on the screen. H...
[3 replies] Last: If all you did was add a few print statements into reverseQueue you ... (by jsmith)
by handra
Array Initialiser
 
Hi All, I am interested by code asked by my friend. The code is below: 1 int a [ 2 ] = { 1 , 2 } ; 2 int b [ 2 ] = { ( 1 , 2 ) } ; 3 4 cout << a [ 0...
[2 replies] Last: Dear Disch, Got it now... It's cool ... Thanks for your reply ..... (by handra)
Switch Case Statements
 
Hi, Wanna check is there any reachable code in the following? Switch (temp) { case '1': .... break; case '2': { if (condition t...
[1 reply] : The if would only be unreachable if temp was a bool or there was an un... (by helios)
Default parameter in inherited virtual function
 
Hi, Does the following code make sense? class Base { protected: virtual void func (bool state = true); }; class Derived : public Base { p...
[6 replies] Last: I doing parasoft unit testing and got reply from that then the rule in... (by shertay)
Print function for Queues
 
I need help with my print function, so I can print the elements in a queue. The print function, that I have now is the last function in my header file. I tried ...
[7 replies] Last: ahh, I finally figured it out! Thank you guys for leading me in the ri... (by NinjaLink)
by bob10
ostringstream doesn't work with string and integer
 
Hi there, i'm trying to use a ostringstream to insert two integers in a string. This is my code at the moment: bool SimuClient::bInitialisiereGrafik(int s...
[6 replies] Last: The problem was that I compiled in Xcode for x64. Switching to i386 s... (by bob10)
by jcylam
values for Handle, Dword, etc
 
http://msdn.microsoft.com/en-us/library/ms645565(VS.85).aspx the function that i want to use. USHORT usUsagePage and usUsage are both information passed o...
[9 replies] Last: Yeah, it's http://msdn.microsoft.com/en-us/library/aa383751(VS.85).asp... (by closed account S6k9GNh0)
by neken
a basic vector<> class and memove
 
When you erase data from a custom made vector in the middle of the buffer, when is it safe to assume you can memmove instead of looping and doing a operator=() ...
[12 replies] Last: Not that I disagree, but vector has better performance if you need lot... (by Disch)
by jcylam
Trouble with MS SDK function (1,2)
 
I am trying to write a c++ program so i can get a gaze tracker to work like a mouse moving the cursor. However, when I used the function WM_INPUT it says i need...
[22 replies] Last: i see i see, thanks so much grey. (by jcylam)
[Problem] Segmentation fault when using list iterator
 
Dear everybody, I got a segmentation fault but don't know what went wrong. I searched this forum but couldn't find any help. Here is the code I have a l...
[2 replies] Last: Thank you so much for your responsive and helpful answer, helios. I di... (by strongdevil)
Can't figure this out. Urgent.
 
After the program calculates the triangle from the first line of the file, I need it to calculate, triangle number 2 from the second line of the file. How would...
[2 replies] Last: You don't check for end of file or stream going bad. Instead, you rel... (by kbw)
by senys
Polynomial class(urgent )
 
P(x) = a0 + a1x^1 + a2x^2 + · · · + anx6(n) (note that a(n) is != 0) value n is called the degree of the polynomial and is stored in the data member degree....
[5 replies] Last: thanks .... (by senys)
Median calculator
 
Hello, I made a program to calculate the median of the numbers you enter, however, I'm using a global pointer. By what I've read in the internet, global variabl...
[2 replies] Last: You should clean up your dynamically allocated memory when you're done... (by jRaskell)
by vijkrr
how to compare unsigned int and int ?
 
hi int main() { unsigned int u = 10; int i = -1; if ( i <= u ) { cout<<" I is less than "<<endl; } else { cout<<" U is less than...
[2 replies] Last: If you want to actually compare them, you will have to cast them both ... (by firedraco)
Rows, Columns, Fields C++ program
 
Hi everyone! Here is the problem I was assigned: Write a program that prints out a series of fields of stars(*). Each field will have n rows and m columns....
[2 replies] Last: Do you know the difference between passing variables by value and ... (by guestgulkan)
by kenr
relationship between string bool operator and map container class
 
Sorry gents but I'm still not clear how the bool operator function relates to the <map> container class. I understand the common element between them is the cla...
[1 reply] : std::map is an associative array that uses an internal binary tree. I... (by kempofighter)
by DJDANG
Why this doesn´t work!!!
 
Hi everyone, could anyone tell my why is tht this codeline does not work?? given Arco as template<typename Arco> map< vector< int >, Arco >::iterator iter...
[2 replies] Last: It doesn't make much sense to me. Why would you want an entire array ... (by kempofighter)
November 2009 Pages: 1... 89101112... 16
  Archived months: [oct2009] [dec2009]

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