General C++ Programming - January 2011 (Page 3)

by holtaf
vector<pair> problem
 
Hi all ,i want to read from file vector of strings and write in another file the number of any word's frequency ,but before that i want to sort my vector; here...
[2 replies] Last: OK ,thanks (by holtaf)
Is the point inside the rectangle?
 
I am trying to figure out if a specified point is inside of a rectangle. I am given the center of the rectangle (represented as (x,y)). And also the height and ...
[1 reply] : I figured it out for anyone who still needs it. bool Rectangle2D... (by kraigballa)
could you tell me whats wrong?
 
I can't find whats wrong with the constructor and yet i get error invalid use of incomplete type 'class Employee' //Employee class definition/interface //co...
[7 replies] Last: oh i see thanks i'll keep that in mind from now on (by Ender210)
by Jsel
Trying to get started on an idea for a CS course
 
Hello, I'm trying to make a program that generates truth tables to assist me in my CS course. I know I could easily find one online but I want to make one mysel...
[5 replies] Last: [quote=Duoas]LOL, what do you mean by that? Recursive descent is sp... (by simeonz)
passing Pointers
 
Not sure how to do this right. a class called mClass. in mClass i have pointer of a cClass. and i also have a variable of bClass. class mClass { privat...
[2 replies] Last: YES thanks for catching that mistake. mClass will hold the variable... (by mothmann)
by fwhale
few errors I need resolved
 
Hi all, Creating a code and compiling in g++ that works as an inventory program. Pretty simple stuff. I'm getting a few errors/warnings that sound like si...
[5 replies] Last: "info" and "item_numbers" are private fields in the Inventory class. S... (by simeonz)
Parameter Passing (1,2)
 
Hi all.. i have another question. I got this question in my university exam. List three ways of passing a parameter (or return value) in C++. there are 2 ...
[39 replies] Last: Here's an illustration of how I visualize the two categories. A sta... (by simeonz)
Access a cross referenced class function inside anoter function
 
Hi!, this is my first post in the forum and it's sad it's not an answer but a question, well... I'm starting with c++. My problem is that I have two cross re...
[2 replies] Last: thanks!... it was so simple I feel like a dumb... now everything works... (by victor vs)
Concerning string::length and Array sizes
 
Hello all, I have a question about using the string::length function to initialize an integer array. I know that the value the function returns is a size_t of ...
[10 replies] Last: Um..... Well actually I'm having second thoughts about what the proble... (by benzensulfonic)
Advice on archiving projects.
 
Hello. I run a small, if not tiny, programming department, which has never had any processes and I am trying to standardize. One thing we've never done well ...
[2 replies] Last: Thank you very much! You're right; we don't need to be audited, but... (by yetanothertom)
2 string name tables to a 3rd table so as each name only once in the last table
 
hello! could anyone tell me how could i: create two string tables ,same size each,check them out to see if they have any same string element inside (in common) ...
[2 replies] Last: thanks a lot for your advices. i am sorry for the brackets but i am ne... (by stavfot)
Totally screwed on comp science course! (1,2,3)
 
Hi everyone, im taking an online c++ course, and i have 5 more programs left to write that are due tomorrow by midnight! I do not get how to write these and am ...
[53 replies] Last: +1 rocketboy9000 (by PanGalactic)
Signal handling in c++
 
Hello, I want to execute a function, say writestat() when the signal SIGINT (Ctrl + c) is pressed. How do I do that? Can you please help? Regards, ...
[1 reply] : Signal handling is covered by the header <signal>, detailed here: http... (by Moschops)
Looping
 
Hi I am creating a loop to check if some elements in what I am working on are related to each other for(int i = 0 ; i < 4 ; i++) for(int j = 0 ; j < 4 ; j++...
[no replies]
Do two circles overlap (intersect)
 
I found a formula that tells me if two circles intersect. I applied it to my code and with the circles that I have the answer came out wrong. I followed the for...
[4 replies] Last: Didn't your last question solve the problem of finding whether a circl... (by quirkyusername)
Sorting vector inside structure
 
Hi everybody, What I did is, I have 2 one dimensional vector which are inside structure. int numberofactivities; struct PopL{ vector<double> RK; //Fo...
[2 replies] Last: The id's resemble to the ordering, i.e. smaller id <=> smaller .RK val... (by onur)
by DBarzo
Factory method in Interface
 
Hi, I have an abstract class which defines an interface for an object. Now I need a factory method to create object. IMyObj.h public class IMyObj { ...
[3 replies] Last: It all depends on where you want the creator to go. But let's assume ... (by kbw)
c++ inheritance
 
Consider this: class A{} class B : public A{} if i have this scenario, i am ok A *a = new B; B *b = (A *) b; what about this A a; A *...
[6 replies] Last: You can use static cast for this. static_cast is not typesafe. ... (by rapidcoder)
factorial,,,
 
hey guys.. i know how to factorial, my problem is how can i do when i used function call... int main() { int n; int factorial,i; cout << "Enter a po...
[11 replies] Last: now i know.. thanks!! :* (by deimon09)
Determine if circle1 is completely inside circle2
 
I am trying to find some sort of equation to determine if circle1 is entirely inside circle2 (not touching). Here is what Disch said, however some people dis...
[2 replies] Last: Alright, I will test that out. (by kraigballa)
January 2011 Pages: 12345... 24
  Archived months: [dec2010] [feb2011]

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