Beginners - February 2012 (Page 52)

Questions about C++ in general
I'm stumped on these questions that were assigned to me: What is the primary C++ syntactic structure that implements an Abstract Data Type? I don't reall...
Feb 7, 2012 at 6:50pm
[1 reply] : What is the primary C++ syntactic structure that implements an Abstr... (by clanmjc)
What exactly should go into a destructor.
Hi, I have two classes, one is for a directory, and another for a file. Directory class, has this data member (alongside others): private: set<file ...
Feb 7, 2012 at 6:32pm
[5 replies] Last: duly noted, I guess it's out of habit before using a pointer and to in... (by clanmjc)
Operator overload, why return reference?
I was working on some simple examples from a c++ book and came across this sample code: #include <iostream> using namespace std; class Counter { ...
Feb 7, 2012 at 6:17pm
[9 replies] Last: Oh ok. I see. But for ++ ++i to work it would have to return a non-c... (by mrbiggles)
by Ishtar
Function type checking
Hello, In an attempt to revise C++ programming I have found something that is concerning me. Please consider this small example program: #include <iost...
Feb 7, 2012 at 6:01pm
[9 replies] Last: Thanks to everyone for such informative replies. Conducting further ... (by Ishtar)
templates
I'm currently studying linked lists and had a question about the template implementation. Do I need to include template <typename T> in both the .h and the .cp...
Feb 7, 2012 at 5:32pm
[2 replies] Last: Thanks! I was curious as the IDE I am using is currently reporting it... (by thephysicsguru)
Insert multiple letters in a deque
Hello. Is it possible to insert multiple letters in a deque when you first initialize it? Something like: #include <iostream> #include <deque> using nam...
Feb 7, 2012 at 5:02pm
[2 replies] Last: so I assume that the order will be: A-B-C etc or C-B-A ? (by shooninjo)
File IO - eof problem
Hi, I'm having a difficult time using eof. After done some trial and error, I still getting the last input being read twice. while(sum.eof() == false) ...
Feb 7, 2012 at 2:36pm
[2 replies] Last: Wow, thanks man, it works!!! Btw, if i put sum >> number; before the... (by cplusx2)
Program Check - POINTERS
Can you please tell me if i have written the code correctly / what are the errors ? /* Introduce int variables x, y, z and int* pointer variables p, q,...
Feb 7, 2012 at 2:30pm
[2 replies] Last: Using the spacebar would also not go amiss. (by closed account z05DSL3A)
Help with Pointers
Can you please tell me if i have done it correctly. Introduce int variables x and y and int* pointer variables p and q. Set x to 2, y to 8, p to the addre...
Feb 7, 2012 at 2:07pm
[1 reply] : It is correct, but you should declare main as int main() instead of ... (by Wisely Done)
Undefined references
Hello everyone, For some reason, when I attempt to compile this on Unix and Linux: #include "my_allocator.h" int main() { unsigned int memory_size = 0; ...
Feb 7, 2012 at 1:33pm
[3 replies] Last: Ahh, that was it. "g++ *.cpp", even though I'm workign with C files. S... (by NewProgrammer)
Please guide about the following errors
Please guide me about these errors , I will be greatful. Lab02_060.obj : error LNK2001: unresolved external symbol "void __cdecl enterdata(class std::basic_...
Feb 7, 2012 at 12:56pm
[1 reply] : The linker cannot find the function enterdata . This means you have ... (by Moschops)
Circular dependencies and headers
Hi, To practice classes, I am writing two classes, one representing a directory and other representing a file. Here is how they look: // This is director...
Feb 7, 2012 at 12:33pm
[1 reply] : see http://cplusplus.com/articles/Gw6AC542/ (by hamsterman)
please help close console in c++
Hi people, I have a program which I declared as void main{} and when in a function I want it to close the console I inserted return 0; but it keeps getting me a...
Feb 7, 2012 at 11:00am
[7 replies] Last: You can return from a function returning void early with return; You... (by Athar)
Copy constructor?
Why dose this code not work im trying to use a copy constructor but for some reason the program just hangs if i remove the code at line 31 and if i don't remove...
Feb 7, 2012 at 10:31am
[4 replies] Last: class myClass{ public: int ptr1; (by ne555)
by poda19
reference files
hi i was wondering is there any reference or help files for other C libraries in the internet? like those references in this site for standard c++ library. fo...
Feb 7, 2012 at 10:12am
[1 reply] : A solid C++ reference is http://en.cppreference.com/w/cpp winsock is ... (by Moschops)
simplifying d0-while loop
i am making this program with nested functions,, i want to simplify the condition of "while". can you suggest any? productlist() { char plchoice; do{ ...
Feb 7, 2012 at 8:13am
[3 replies] Last: Well, it's a boolean function, so it can return one of two values, tru... (by MrHutch)
by Steves
What do pointers have to do with Functions
#include <iostream> using namespace std; int addition (int a, int b) { return (a+b); } int subtraction (int a, int b) { return (a-b); } int operatio...
Feb 7, 2012 at 7:48am
[8 replies] Last: No this is great I understand it now. But everywhere I'm reading onl... (by roberts)
Error C2784
Hello! I'm a first time poster, I apologize if this question is formatted incorrectly :) I've looked over the forums and other websites regarding this error....
Feb 7, 2012 at 7:08am
[2 replies] Last: Nothing like a fresh perspective! Thank you very much! I knew the prob... (by Im Tryin)
Hello Virtual Function Animal
Hello Guys I am trying to write C++ codes but i got some error.
Feb 7, 2012 at 6:45am
[12 replies] Last: Actually there're 3 errors: 1. You cannot access the private member 'n... (by coder777)
by BNut
What is the meaning of const in this case???
Hello, Could anyone explain const for me in this case. this's a code class Employee { public: Employee(const string &,const string &); ...
Feb 7, 2012 at 4:53am
[2 replies] Last: Thank you Peter87 (by BNut)
February 2012 Pages: 1... 5051525354... 64
  Archived months: [jan2012] [mar2012]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.