Beginners - July 2009 (Page 16)

by aylnon
Include problems with headers
 
So, I'm working on defining a class, it's functions, and using them in a program. I want to define the class in a header file, the functions in a source file, a...
[3 replies] Last: In the header, then source files which #include your header will also ... (by Bazzy)
by Jauch
Using overloded [] problem
 
Hi! I have this code: class A { public: void *operator (const int &index) { return item ; } public: void **item; }; class B { ...
[1 reply] : That is because item_a is a pointer, not an object you should be able... (by Bazzy)
Eclipse Compiler
 
I have just started learning C++ and the book I am using wanted me to create a simple program: #include <iostream.h> using namespace std; int main() { co...
[1 reply] : You should have <iostream> (Current Standard), not <iostream.h> (Old) ... (by Bazzy)
outputing a 2d array to file
 
hi, i am new to c++ and not sure how to output an array to file in a particular structure. the file needs to have elements of each row seperated by spaces or c...
[1 reply] : You should be using 2 for loops for reading the data, from that you ca... (by Warnis)
where is "namespace std" defined
 
Hello everyone. I am wondering what is exactly in "namespace std", so I want to find out where it is. Thanks for your help.
[3 replies] Last: Oh, I understand. Thanks! (by Lilium426)
loop inside the loop hlp
 
plz hlp me here masters! #include <iostream.h> void main() { int z,x,y; { for (x=1;x<=2;x++) { for (y=1;y<=5;y++) { z=x*y; cout<<z<<","; } cout<<...
[1 reply] : No need for embedded for-loops #include <iostream> using namesp... (by Tevsky)
math question for my program
 
I am about to start a program that requires using a formula that calculates the distance of a launched projectile given the velocity and angle. The formula is:...
[4 replies] Last: I compiled the program but i don't think its working. I am not very g... (by vince510)
Accessing variables in a structure
 
Hi, I have defined a structure that has six variables in it: let us say that the structure is named PhaseState and the variables are x, y, z, xd, yd, and zd....
[5 replies] Last: oh alright, i got it. i had read in the cplusplus tutorial that only ... (by theturbanator)
Storing pointers to dynamic memory in a <map>
 
I'm running into some problems storing pointers to objects I've allocated in dynamic memory with a key stored created in stack memory (relevant code only includ...
[8 replies] Last: OK I've done this in phidgetmanager.h : // Definition (?) outsid... (by CodeBugs)
Back to basics
 
OK, back to some really basic stuff. Would someone be kind enough to explain this program, it's part of the beginners c++ tutorials !! (I said it was basic) ...
[6 replies] Last: Like it has been said, you can just think of a "reference" as just bei... (by firedraco)
Are pure virtual constructors possible ?
 
Hi there, I'm attempting to write a base class and some derived classes for Phidget modules and am currently wondering how I might include a virtual pure con...
[10 replies] Last: kempofighter, Thanks for your reply, I think you've answered what I... (by CodeBugs)
I have never seen this error before
 
The error is "Unhandled exception at 0x00415360 in grid.exe: 0xC0000094: Integer division by zero." what I'm trying to do is find a random number on a grid....
[3 replies] Last: Ok I've found where my problem is How do I set randnum to the number ... (by fire child)
by Force
Exercise with multiple includes
 
Hi!I'm new here and I'm an absolute beginner and I'm reading a book here about C++ and there's a topic about multiple includes and header files.There's an exerc...
[4 replies] Last: Thanks for the reply. (by Force)
by Bv202
Fractions
 
This is more a math question then a programming one, but as I need to program it, I guess it's ok to post it here. I need to make an addition of 2 fractions....
[5 replies] Last: My bad ^^ (by mcleano)
<< and >> operator problem
 
1. `std::istream& operator>>(std::istream&, frac&, char&, frac&)' must take exactly two arguments 2.33 `ch' undeclared (first use this function) 3.39 redef...
[4 replies] Last: oh yes.That's ok. and discoverable .thank u again (by areyoupp)
Get filename from path
 
I want to split a path into the filename and the directories. I have tried to sscanf but i cant figure out how to set and forward slash as a white space s...
[2 replies] Last: thanks helios, i can now carry on with my projects thanks to you! (by steelslasher)
getline() and segmentation fault
 
My problem is that this part of my code keeps returning a segmentation fault at "currfile.getline(value, 256, '\n');". What can i do to fix this or avoid it?...
[2 replies] Last: Thanks helios, that worked. (by prolink007)
by easyz
Pointers and dinamic memory
 
Hello, I have to do some program, similiar to the Facebook. I wrote the syntax, but it doesn't compile...I don't know what the problem is... Will appreciate...
[8 replies] Last: This is stiil me, but from another username. the problem is not in th... (by Timtam)
by Raupi
100000000000000000000000 in cpp
 
Hello there; i am trying to declare a variable, 10^23 in cpp; i already tryied: #include <stdio.h> #include <math.h> int main(void) { unsigned lon...
[5 replies] Last: Thanks to everyone; these helped a lot. (by Raupi)
What is exactly the difference in << and >>
 
Some time ago I did half the tutorial about C++ programming, and because its a while ago I am going trough it for a second time. But I just noticed I never real...
[2 replies] Last: Ok thanks for your clear and fast explanation :D (by SoulRyder)
July 2009 Pages: 1... 1415161718... 20
  Archived months: [jun2009] [aug2009]

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