General C++ Programming - February 2014 (Page 31)

About lower and upper bound in std::set
 
dear all, I have a question about std::set::upper_bound() and std::set::lower_bound(); In the following code, I generate a set s that contains the values...
[1 reply] : std::set::lower_bound [quote=cplusplus reference pages]Returns an it... (by MrHutch)
How to make programs c++
 
I go 1st year as computer engineer, and what i struggle with is figuring out how to solve problems at school. I understand programming, but when it comes to ass...
[6 replies] Last: I would suggest getting familiar with the basic concept of C++. Read s... (by james26)
(opengl, c++) Functions and data structures in a square and rectangle
 
Hi guys. I have a square at the top and a small rectangle at the bottom that can be moved through the the 'a' (left) and 'd' (right) keys. When I move the squar...
[no replies]
Is it possible to overload a class for passing to a function?
 
I want to be able to do someFunction(MyObject) rather than someFunction(MyObject.getWhatIWant()) I know I can do &MyObject, MyObject() and MyObject by ...
[7 replies] Last: Ah sorry Duoas, I'll check again when I'm at a computer. It's not pra... (by Zephilinox)
issues with istream and ostream operator overloading
 
I've been at this for a few days now, and can't seem to find the answer, maybe someone here can help me. void CName::WriteFullName() const { cout << m_f...
[4 replies] Last: Thank you for your input, what you said put me on the right track and ... (by SeaLabEZF)
by G23M
baseball program, batting and pitching
 
I'm new to c++ and I have to create a program that: prompts the user for the scenario (pitched ball, batted ball), and then prompts the user for the informatio...
[no replies]
for loop
 
what the difference between #include<iostream> using namespace std; int main() { int count, sum=0 ; for(count=1;count<=10;count++) sum += count*co...
[2 replies] Last: thank you (by krisapp)
Passing an object with templated static array into another
 
This problem just seems really strange to me because it is simple yet for some reason my class cannot pass into another class. The class PASS_OBJECT has a sta...
[2 replies] Last: @smac89 Ok, for some reason I'm thinking about copy constructors but ... (by lostwithcpp)
Pass by Reference for Linked List
 
Hello, I cant get my insert function to insert to the head of the list I dont think I'm passing the pointers correctly. #include <iostream> using namesp...
[4 replies] Last: Here is what I implemented it with: void insertList1 ( list1 ** hea... (by Joshua Schweigert)
exercise from Stroustrup's text book
 
This is from chapter 13. Create a class that draws a box with rounded corners. I got the math figured out, but for some reason the lines are not being drawn to ...
[no replies]
File descriptors?
 
Consider the following code segment where program is a valid executable file: if ( fork() == 0 ) { close ( 1 ); close ( 2 ); ...
[4 replies] Last: Thanks smac (by cppnoob25)
by Renato
error c2065 'balance': undeclared indentifier
 
I receive this error, been couple hours try to understand, but i havent find the solution. i get the error here: case 2: currentBalance(bal...
[13 replies] Last: Works now. Well till now. :) for you great help and patient with me. (by Renato)
how to separate login for admin and user? c++
 
How to compare the username and password entered by user with the data(username and password saved in before) in the admin array and customer array, so for e...
[1 reply] : if (login.is_open()) { cout << "Database exists." << endl; if... (by Smac89)
the putchar function
 
I understand the below program, except when EOF is reached and the state is SLASH, then it does something with the putchar function. I thought the putchar funct...
[2 replies] Last: It is just simply division, by a lot of 1's. This is what it is suppos... (by Smac89)
Improper Destruction of Objects.
 
Hello i have two simple classes: Author and Book. Class Author contains class Book as a member. Additionally i have a list of Book objects within each Author cl...
[2 replies] Last: thanks a tons. (by Joy Smoking)
Simple XML label generator
 
Hello all, I'm having a slight issue with my code doing what I want it to (story of my life) and was trying to see if anyone had some ideas. I was trying to ...
[3 replies] Last: "\n" should work. Just out of curiosity, try "\r\n". I think there a... (by Stewbond)
C++ Undefined Reference to `WinMain@16'
 
I'm learning C++ and I came across a strange error; Everytime I want to build my project, I get "undefined reference to `WinMain@16'". Here's my code: Main cla...
[3 replies] Last: The solution problem is still the same... Try this: http://forums.... (by Avilius)
by MAAASD
recvfrom blocking to non-blocking
 
Hello guys, in recvfrom function of socket programming, i believe it's a blocking function and when calling it, it waits to receive data and block the whole...
[1 reply] : Problem solved using ioctlsocket function :) (by MAAASD)
use of typename keyword
 
I was going through tutorials and read that typename keyword is required whenever we need to define a object as follows: typename A::C d; where C is a neste...
[2 replies] Last: In a template that we write, there are two kinds of names that could b... (by JLBorges)
by ak16
File Handling
 
Read the file Write in to file Edit/Append file
[11 replies] Last: But i want something, by using this I can delete last line from file? ... (by ak16)
February 2014 Pages: 1... 2930313233
  Archived months: [jan2014] [mar2014]

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