General C++ Programming - July 2011 (Page 4)

question about deleting an abject
 
hi, when i create an object of my class in main function. after program reached the closing scope of main will my object delete autonatically or should i free ...
[2 replies] Last: Objects allocated on the stack ( Type myVariablke; )will be destroyed ... (by bartoli)
My Function Doesn't Work
 
I'm working with vectors (not the STL vector ), and I'm trying to get the angle between two vectors. I've created a function that returns the result of a dot o...
[6 replies] Last: Rambo, your equation doesn't work. I broken down your equation (so C++... (by closed account zb0S216C)
by h9uest
pointer to member function
 
Hi All: When I implement a member function of a class, I want to sort a vector using "sort" defined by stl in <algorithm>. Every element of the vector to ...
[5 replies] Last: @jsmith: Thanks for the fancy boost lamda expression. I'll look a bit ... (by h9uest)
I am a beginner and i need help in creating program for this
 
Hi, i am a beginner in c++ and i need help in typing out a program for this, anybody know how to do this?? Step 1: With the key written repeatedly over the i...
[2 replies] Last: http://img31.imageshack.us/img31/8861/image1mcg.png http://img233.ima... (by alexwong89)
Need of Overloading Operators
 
Hi, I am having following doubts 1. If = operator is already overloaded for a class why do we need to explicitly write code to overload = operator . 2....
[6 replies] Last: Could be possible that the strict definition of a singleton doesn't al... (by webJose)
helppppp
 
What are the values of i and n after this loop executes? int n = 0; for(int i = 0; i < 12; i++) { n += 3; }
[3 replies] Last: at the end n=36....i=12 (by rambo1177)
by Brad1
ASCII character table. Help needed.
 
How would i get this program to print only ten characters per line? #include <iostream> using namespace std; int main() { for (int i = 33; i < 127; i++...
[6 replies] Last: #include<iomanip> cout<<setw(4)<<//some var<<setw(4)<<//some other va... (by buffbill)
Help with fork()
 
Hi, I'm wanting to do some stuff with fork(), but I ran into some problems. Here's my code: #include <iostream> #include <sys/types.h> #include <stdio.h>...
[6 replies] Last: Indeed. Thanks for letting me know. It's too bad that what I was usin... (by James Grider)
C++ project ideas
 
Alright, I have looked up many times C++ project ideas. But the only thing I am finding is highschool level projects. Does anyone have some more advanced c...
[2 replies] Last: Well really I only have ideas for embedded programming. But I was look... (by spectrem12)
Find character within string
 
I have a word from a parts of speech wordlist that looks like this: aardvark\N I would like to write code to separate the "\N" so that the program will fi...
[6 replies] Last: much thanks... (by paulmcco)
SubString Help
 
Im currently working on something and fell on a stump and cant seem to get out of it. What im trying to do is Find text and after the text get the next word ...
[4 replies] Last: Turbined tested that method and still does nothing :( and at Zhuge is ... (by WetWilly)
problem with overloading constructors
 
Hello all, thanks for your time. I'm writing a program that reads employee data from a bin file, and creates an ADT using a CLASS to represent the data for the...
[3 replies] Last: Well so far I think I'm on the right path, got it to pass the data to ... (by Technyque)
Strcmp does not recognize string1 as equal to string2
 
I have a problem with the format of my text file...The file is a list of words from the dictionary(27,000 words). For whatever reason, when I search for a word...
[4 replies] Last: I figured out a solution: Download a new wordlist... worked like a c... (by paulmcco)
by h9uest
Separate declaration and definition of static member functions
 
Hi All: I'm trying to declare my class in a header file. class MyClass { static int i; public: static void setInt(int k); }; Then I do t...
[5 replies] Last: Beeeaaaauuuutiful! Thanks for the link, dude. (by h9uest)
input from a file
 
Working my way through the Project Euler problems here, and I have a quick question: Given a text file: 45646465465465478932187 12317894132198719465417 ...
[6 replies] Last: Thanks sloppy9. For some reason, my output was incorrect with your li... (by vince1981)
Converting a char to a string...
 
Hello, I'm trying to compare a char to a string...Ultimately I'm trying to search a text file for a specific string...so far, my code looks like this: int ...
[3 replies] Last: The method c_str() is part of std::string, which I assume is what you ... (by webJose)
Overloading << and inheritance
 
Hi everyone! I have a question about inheritance and overloading <<. I have an abstract base class A, and a publicly derived class B. In both classes I want ...
[1 reply] : One possible alternative: #include <iostream> class A { pu... (by andywestken)
by Brad1
Help please!
 
What are the values of i and n after this loop executes? int n = 0; for (int i=0; i < 4; i++) { n = n + 5; }
[3 replies] Last: i is popped and n is left with 20. Instead of asking these silly ... (by closed account zb0S216C)
Tic Tac Toe
 
Hi, I have been working on this Tic Tac Toe project for literally over 40 hours the last few weeks, and I cannot get it to work right. Right now I'm working on...
[1 reply] : In your functions that return Booleans, half of the time you explicitl... (by kooth)
Exception, delete doesn't call destructor in catch block???
 
I don't understand why delete doesn't call a destructor in a catch block, because i want to clean up if something goes wrong? I have created minimalistic test a...
[2 replies] Last: Great explanation, thanks for tips. (by savavampir)
July 2011 Pages: 123456... 30
  Archived months: [jun2011] [aug2011]

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