Beginners - August 2009 (Page 15)

Namespace problem (I think 1!)
 
Hello, I'm getting an 'XXX undeclared error when I try to compile with the following two header files (I've not included the C++ code as I don't think it's r...
[4 replies] Last: There is never any situation where you need to have circular includes.... (by Disch)
Polymorphism question
 
Let's say I have two classes: struct color struct red:public building I know from the tutorial that a "color" pointer can point to an instance of "red". ...
[5 replies] Last: The idea was that when it came to saving pointers, I'd just have to re... (by Impacatus)
by cnewby
read from file and output to 2D array
 
I'm having trouble understanding this. I want to make a function that reads from a file and then outputs the info in a 2D array. Here's what I have so far: ...
[6 replies] Last: Cool! Thanks so much for the help! (by cnewby)
Reverse string with Pointers
 
I got the gist of the project, but it seems as if I am missing something simple. Basically, I am trying to reverse a set a characters that a user input. Now I b...
[3 replies] Last: Thanks for the help. I figured the assigning the temporary variable. A... (by chasescoot066)
Criticize my calculator please.
 
Hi, I'm really new to C++, and I just wrote my first calculator. I know there are ways to do it better, but I don't know those ways. Could anyone please point o...
[4 replies] Last: Ok, thanks very much everyone. I read up on ending my programs, and am... (by Retro94)
by cnewby
updating an array
 
I'm not sure if I'm phrasing this right... I'm trying to read an array, copy info into another array and then work with that new array. For instance: -do ...
[4 replies] Last: multidimention arrays = YUK YUK YUK If you are using pointers you c... (by Disch)
Best way to create "modes"
 
Hello, I am writing an app and I was wondering how can I implement "mode" constants, like the openGl's GL_*, for example, I need for a part of my program th...
[3 replies] Last: That's what I do. (by Disch)
by MiaZas
saving and loading vectors from a file
 
I am writing a program in which I will need to save the vectors I create and modify so a file, and then I will need to be able to close the program, open the pr...
[3 replies] Last: Line 80: getline(inputFile, Numbers[ i ] ); Numbers is a vector<... (by Bazzy)
power factor function
 
Guys: I am supposed to write a function to compute the power factor. The formula is (peak energy + off peak + standard)/ kvah . The problem is that i should...
[no replies]
can i use class instance variables in functions that aren't part of the class?
 
can i use class instance variables in functions that aren't part of the class? this is a simple example of my problem. class person{ public: person(); ~p...
[8 replies] Last: sry webjose i normally would but i'm away from my compiler for a few d... (by robman8855)
creating a palindrome program
 
I'm trying to master my knowledge of C++ by doing some random practice programs I find here and there. The one i'm trying to make right now is a program that as...
[4 replies] Last: Come on, Google is making billions for a reason. http://www.cpluspl... (by webJose)
Error: segmentation fault
 
Hello people, I'm new to this community, but I'm also new to C++. I already know some programming languages so learning the basics of C++ was pretty easy, but I...
[3 replies] Last: I don't see any problems with the code that would cause a segmentation... (by kempofighter)
Simple Download Program
 
Hello, I was reading the source code of wget and it is so complex and confusing, then i'm here asking for the code of a very very simple application that down...
[1 reply] : That's what libcurl is for. Actually, you've asked this, already. (by helios)
by MiaZas
binary vs. decimal
 
I am trying to figure out the decimal equivalent of 11011 and I got 16, is that right? And I'm also tryin to get the binary equivalent of 39 and I got 0011, is ...
[2 replies] Last: You can also read this: http://www.cplusplus.com/doc/hex/ (by Bazzy)
by MiaZas
arrays and memory
 
Can the locations of the contents of an array can be spread out all over the memory, or do they have to be next to each other?
[1 reply] : Array elements are by definition in adjacent memory locations. A li... (by helios)
by MiaZas
nested loops
 
I am trying to write a for loop inside the while part of a do while loop. Is this possible? Dev-C++ keeps giving me errors saying i'm missing semicolons/parenth...
[5 replies] Last: Returning a Boolean value means that it either returns true or false, ... (by MiaZas)
by btmorr
cout causing a variable's value to change
 
Hey there, this problem has been bugging me all day. I'm currently attempting to write some code that will (in theory) record track lengths of a particle going...
[3 replies] Last: Thanks for the quick response. Sounds like I'm in for a "fun" afterno... (by btmorr)
Exercise: map<K, V> m(cmp)
 
Hello everyone! I am doing some C++ exercises again, and ran into trouble. Exercise text: 7-1. Extend the program from ยง7.2/124 to produce its output...
[2 replies] Last: Thanks for the answer, but I can't use those things. I'm trying to use... (by Terviseks)
by Null
How do i know if a variable is in register?
 
Just a quick question, if i declare a variable like this: register int i; As far as i know register is just a request for compiler. So how do i know ...
[4 replies] Last: Thank you for help (by Null)
Using Templates to define classes in C++
 
Hi, I am a beginner in C++ and to get my hands dirty I was trying to implement a heap data structure. I have defined two header files, myheapnode.h and myhea...
[6 replies] Last: Think about it this way. Say you have template< typename T > ... (by jsmith)
August 2009 Pages: 1... 1314151617
  Archived months: [jul2009] [sep2009]

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