General C++ Programming - April 2012 (Page 6)

increment operator query in vector (1,2)
 
Hi Forum, While working on vectors, I came across this situation where I am not sure how values are evaluated. I guess I am missing some link for the usage of ...
[32 replies] Last: > it is simple for simple cases, but I don't think people realized tha... (by JLBorges)
by itcsr
Selection Sort/Quick Sort
 
Im writing a program to preform quick sort and selection sort on the same list, and print out the result of each with the time it takes for both Sorting algor...
[3 replies] Last: You do know about quicksort, don't you? And no, it shouldn't resort i... (by Pravesh Koirala)
How to call on a private method in the main program?
 
Hello! I have a private method that is as follows: void BEAM::calc_area(double b, double h) { A=b*h; } I want to call upon the method and pass the var...
[11 replies] Last: Thanks for the help, everyone! I figured it out. I didn't want to do i... (by Cirabou)
Parsing gdb errors
 
Hi, I've been working on a code which gives a segmentation fault when I run it, I tried using gdb but I am unable to parse the messages. Program received...
[2 replies] Last: Nice catch, uid was the problem, it was 0 in some cases. Thanks a lo... (by tarun88)
Error message help - compile error
 
hi guys i am in desperate need of help. I am currently writing an AI disseration for uni. My experience with c++ and netbeans is limited and ive come accros...
[1 reply] : I'm not quite familiar with NetBeans. Why don't you try CodeBlocks? It... (by Pravesh Koirala)
by ljs
const modifier on pointer attributes?
 
Hi, i have a question related to the const modifier for class methods. If I have a class like this: class A { int b; void printToScreen() con...
[10 replies] Last: ok, I see that now. (by ljs)
Linked List Sorting
 
I have to sort my linked list according to int id . The each node in linked list contain: string name int id int salary This is my wrong sorting c...
[3 replies] Last: if you add this to your class: bool operator<(LinkedList* a) { ... (by viliml)
vectors and classes in a constructor
 
In the following program, the class 'Card' has a vector of Class1's, and an object of Class1 inside of it. In Card's constructor, I've been able to assign the ...
[3 replies] Last: I think I know exatly what the problem is! try adding a semicolon(';')... (by viliml)
message while running debug: "An Access Violation (Segmentation Fault) raised in your program"
 
Pretty much what the title says. My program has been stopping at a certain point inexplicably. When I ran my program in debug mode and it reached that point, a ...
[3 replies] Last: I'm using Dev-C++ 4.9.9.2, which I think is kind of an old compiler a... (by S G H)
by puerto
Help with a Rational Number code
 
I need some help.. I can't get it to work. The / operator is giving error also the friend ostream. #include <iostream> #include <string> #include <iomanip>...
[1 reply] : 1- Use [ /code wrapper. 2- Use indents. 3- Don't throw the code at ou... (by TheDestroyer)
char[] gets split
 
#include <C:\tLib\tofiffeLib.h> #include <string> #define č char(159) #define Č char(172) #define š char(231) #define Š char(230) #define ž char(167) #def...
[2 replies] Last: thank you! (by tofiffe)
Need some help
 
Hey guys, I'm trying to write a program to read an unknown number of values from a user-specified file, and save them so that the program can later determine th...
[2 replies] Last: Yeah, I'm using the book to try to get up to speed before the class e... (by Asatchaq)
Help needed, array being called into functions and multiplied.
 
Hey so Ive been working on this for a while now and nothing seems to work. I need to take an array (prices) and let the user enter the percentage that they wan...
[2 replies] Last: Line 43. Do you really want i > 10 as the control condition? (by cire)
Need a Desperate help
 
Hi there guys I am in need of desperate help with classes in c++ my teacher is out of town, unreachable and I have to submit this homework by 30th. Now I have w...
[1 reply] : Are you getting help with this? You don't have pm's enabled. Also. If... (by Vlykarye)
passing variables from main to private method
 
Hello! I have a private method that calculates area. I also have a public method that displays this calculated area. I wish to pass two user-inputed variabl...
[2 replies] Last: THANK YOU SO MUCH! (by Cirabou)
Quick question about pointers.
 
I have int** matrix and I want to set each element to zero, how would I go about doing that, I have tried *matrix = new int ;//it does not like this for...
[4 replies] Last: Ah I see, thanks. (by Neb1000)
Resetting ifstream
 
I'm reading lines of text from a file and I need to loop through the entire file twice but I can't figure out how to do it...I have this so far: int main(...
[2 replies] Last: HashDictionary::HashDictionary(istream &sin){ while(!sin.eof()){ ... (by JLBorges)
GetFileAttributes != GetFileAttributesW
 
Hello All, I will apologize in advance for a confusing/strange question here... I am using a FileSystem interface that is defined in my project. That interface...
[6 replies] Last: It depends entirely on where windows.h is included in relationship to ... (by Disch)
vector of classes: what is the '*'?
 
In theory a simple question: Normally when declaring a vector of classes in c++, I do something like the following: #include <cstdlib> #include <iost...
[3 replies] Last: It makes sense if you intend to store object of derived classes in tha... (by ne555)
Priority Queue
 
I have queue class, priority queue class, heap, itemType class. I am not sure how/what I need to set up the main program for my project below. If anyone has a...
[no replies]
April 2012 Pages: 1... 45678... 49
  Archived months: [mar2012] [may2012]

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