Beginners - April 2011 (Page 39)

pointer to class members problem
 
hy, I'm learnig working with classes and have problem with pointers to members problem is in comment... any help please :) class tijelo { friend void p...
[3 replies] Last: no :/ if main () would be friend of a class then private members will... (by sasanet)
pointers stack
 
assuming stack interface: where data is a pointer to some value and next is the next pointer. void *Stack::pop() { Element *popElement = head; voi...
[8 replies] Last: crystal clear...thanks...just needed feedback... (by jackel7777)
GA TSP problem
 
i am trying to code the GA TSP. anyone who heard of GA TSP, you should've heard that you first need to generate a bunch of parents. THe problem is how to ge...
[1 reply] : i think is brute force. (by hunkeelin)
user input set data.
 
#include <iostream> #include <string> #include <sstream> using namespace std; class Student{ private: int size; public: Student object (int...
[6 replies] Last: hey hunkeelin: is this same thread as "dynamic alocation" you posted. ... (by sasanet)
how to dynamically allocate
 
int main(void) { int s = 0; int *instances; Student object; cout<<"please enter the object size"; cin>>s; object *instances = new (object ...
[5 replies] Last: thanks alot... (by hunkeelin)
Deleting corresponding values in Vector
 
I want to delete voltage coresponding to the device name. For example the earlier code deletes name only.I want to delete the voltage also, so that voltage will...
[1 reply] : for( it=device.begin(); it!=device.end() ; ++it ) { if( (*it).nam... (by matsom)
Using multiple Or operators in a while loop
 
I was wanting to create a loop for data entry verification so that it loops only when a user enters a wrong number. In my code below, you can see that the while...
[2 replies] Last: It looks like I needed to input && operators instead of || operators. ... (by teason6)
const and temporary
 
Im reading 'Thinking in C++' by Bruce Eckel and on chapter 8 about constants there is this code, which should be an error as accoring to Eckel the return of the...
[4 replies] Last: ^Yeah, I was confused at first too until I set my warnings to level 4 ... (by firedraco)
i'm having problems
 
I'm pretty new at this c++ langauge and I don't know why my code does this. When the console asks you your name and you just put in one word, the program seems ...
[4 replies] Last: thank you. The problem was fixed and my program works perfectly. =] No... (by crzypersn)
by theman
need some help(update)
 
I have this code. The problem is that the program compile but it doesn´nt work when try to start the program. I start my program from cmd. I use diversion to s...
[2 replies] Last: Hi theman, I've been looking at your code. From what I can gather, yo... (by dangrr888)
Reading a file
 
Hey! I'm trying to store the first line of a NotePad document into a string. I already know how to "Open" this file so it can be read and written into, i know...
[10 replies] Last: Sounds good! But i need help getting started still D: This is my funct... (by RecoJohnson)
by ascii
pointer test
 
i wrote a little test to using pointers and arrays to see what the next data slot would be after the last element of a char array, and i expected it to be a str...
[4 replies] Last: okay thankya :) (by ascii)
problem with (try catch)
 
hi guys please see this code: int x; try { cin>>x; } catch(...) { cout<<"input error"; } if user input an int(), not problem but if user inp...
[6 replies] Last: i understand my problem solved thanks guys (by CsqHossein)
Is this right? I can be sure...
 
For another assignment, our teacher asks us to take four sum functions (which take from 2, up to 5 variable) and have the last three functions call the one befo...
[1 reply] : The former. If you use a function, ever, it must have its own set of p... (by ultifinitus)
im tired
 
ok so im making a program and i want to put the classes in a seperate cpp file than the main program. is there a way to do that and get them to run together. ...
[3 replies] Last: thanx next time ill just ask u fer a title :P (by cainen172)
Comparing more than two variables?
 
Hi all, In this program (Battleships game) I'm trying to place the ships in a linear fashion (numbers between 1 and 25). I'm trying to use "if" statement...
[2 replies] Last: Use the AND operator. For example: if (var1 == var2) || (var1 == va... (by andrezc)
Read until end of data, not end of file...
 
Hi all. Long time lingerer, first time poster. I'm having a problem with a roster program assignment. I was given two files to read, one for each baseball te...
[1 reply] : I think the simplest way is to "clean up" your arrays before using t... (by sasanet)
Count lines on text file
 
Hello, I want make a line count program in C. For example: I have a text file with content: hello my name is John this file have 5 lines. Ok, I need coun...
[7 replies] Last: Thaaaaaaaaaaaaaaaaaaanks! Solved! The code working is: #include<s... (by andrezc)
while statement! help!
 
Hey guys, im new with the C++ program. I need help with this question about while statement, cus i have no clue about it. For the following C++ program : ...
[3 replies] Last: num's value starts at 0. Every time the while loop runs, num is increm... (by Stupebrett)
Need help re-writing this into "better" code
 
I've written a travelling salesman problem (TSP) algorithm, that finds the quickest route between randomly distributed points, using brute force. This seems to ...
[7 replies] Last: You could make a point/vector class. Then the distance will be (u-v).... (by ne555)
April 2011 Pages: 1... 3738394041... 55
  Archived months: [mar2011] [may2011]

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