Beginners - March 2013 (Page 2)

[Linker error] undefined reference to 'function'
 
I've been struggling with this for the last two hours, not sure what I'm missing. I've searched the forums and used Google, but can't find an answer that I und...
[2 replies] Last: The function prototype, (lines 5-7), function definition (lines 46, 77... (by Chervil)
Stuck... on a while loop! Help please!
 
Write a loop that will accept numbers from a user as long as he wishes to enter numbers. Calculate the sum of all numbers that were entered and when the user ex...
[4 replies] Last: Okay. I see. So I just changed the condition to now be ( xNum != 0) ... (by mcnevermore)
Dynamic memory (new) question.
 
I'm just curious, in the tutorial it allows for: pointer = new type; and pointer = new type ; If the point of dynamic memory is that it's length i...
[16 replies] Last: chipp, in the first function, str is a pointer that points to memory a... (by cire)
by eXord
Copy constructor - "invalid memory allocation"
 
So I have a defined copy constructor which deep copies elements of an array, however when I run the program, it crashes and I get the error: "Invalid allocat...
[3 replies] Last: Thanks for your replies, @JLBorgess this way seems interesting, i've ... (by eXord)
C++ equivalent for tmpfile()
 
http://cplusplus.com/reference/cstdio/tmpfile/ Searching the Reference, I couldn't find a C++ stream equivalent for the above.
[9 replies] Last: libstdc++ specific (AFAIK, works only for char and wchar_t): #includ... (by JLBorges)
by zukias
Question on class pointers...
 
#include <iostream> using namespace std; class MyClass{ public: int nValue; }; int main() { MyClass* pMC ; for (int i=0; i<5 ; i++){ ...
[6 replies] Last: Thanks for replies anthony & framwork, I think that cleared it up for ... (by zukias)
How to extract the bits from a binary number?
 
Hi, I want a function that, given two integers n and k, returns the kth bit of the binary representation of n. Does C++ come with such a function? If yes, wh...
[4 replies] Last: Thanks a lot! (by baby bunny)
Trouble with overloading the << operator
 
Back again ladies and gentlemen. Below is a cpp file from an assignment. The program consists of three files, th lcock.h, the clock.cpp, and the main.cpp. M...
[2 replies] Last: There is no reason to be calling new and using pointers in that code. ... (by cire)
What's the use of explicitly defining a destructor?
 
What's the use of explicitly defining a destructor? When an object goes out of scope, its default destructor is called and memory space referenced by the *this ...
[2 replies] Last: Deallocating memory isn't the only reason why one should overload the ... (by closed account zb0S216C)
Linear Search for Lottery Ticket
 
I know this is a popular problem but I need help stopping my program from exiting when 'y' or 'Y' is entered. The problem asks to provide a winning lottery tick...
[2 replies] Last: Hey thanks for the help Chervil. I cannot believe it was something as ... (by solemnservant)
Problem with Visual C++ 2008 error LNK2019: symbole externe non résolu
 
Hi, I wrote some code on an online compiler and it worked out well. But when I move it to Visual C++ 2008 I always get the errors "error LNK2019: symbole ext...
[7 replies] Last: Yeah it seems fine for the moment. Thanks! (by baby bunny)
Problems with reading a file.
 
I got an input file like this. MNSD sjs 20 30 40 50 60 70 85 97 50 abcd efgh 10 20 30 40 50 60 70 80 90 10 one two 79 50 78 20 64 54 the format should be word...
[1 reply] : Please use code tags and indent. The extraction operator (>>) ignores... (by Lowest0ne)
what does return 0 in main function do?
 
What instruction does it perform? it has to return a value, but then return a value where? please no assembly code as i haven't studied that yet. :)
[8 replies] Last: this works too.. //image this was a program called SOMEPROG.EXE ... (by DysFunc)
doubly simple linked list
 
#include <iostream> using namespace std; struct node{ int data; node *next; node *prev; }*head,*tail; void addNodeF( int data ){ node *newnod...
[15 replies] Last: As i understand function addNodeF has to add a new element at the tail... (by vlad from moscow)
Passing a 2-D Array To A Function
 
Hello, I recently wrote a program that uses recursion to fill an object. EX. ***** * * * * ***** To: ***** ***** ***** ***** The probl...
[4 replies] Last: It means that function fill is invalid. Investigate its code. (by vlad from moscow)
question from the tutorial
 
Here's the code of a default copy constructor of an object from the C++ tutorial: 1.CExample::CExample (const CExample& rv) { 2.a=rv.a; b=rv.b; c=rv.c; 3.}...
[4 replies] Last: i got it... Thanks for the time :) (by Mustehssun)
How to delete console history?
 
I wrote a brief code to show what I want: #include <iostream> #include <string> #include <sstream> int main() { unsigned long number; std::s...
[6 replies] Last: Are you trying to do this in bash? No, I'm trying to do this in a con... (by Vidminas)
by aslv
HTML through C/C++
 
Hello! I need to access html code of a webpage using C (or C++). Could you recommend which libraries I have to use? Thank you a lot.
[3 replies] Last: Thank you. I successfully solved my problem. (by aslv)
Can't read second line from a file
 
I have a file that look's like this: last_name first_name grade2 grade2 grade3 grade4 grade5 grade6 grade7 grade8 grade9 grade10 I have to make a output file ...
[1 reply] : fin >> v1; for(int i=0;i<10;i++) { fout << v1; fin >> v1; fout << ' '... (by fg109)
Expected Primary Expression before "int"
 
I have no clue what to make of this error, really need some help with this one. Link To Code: http://gyazo.com/475fa6fc8fe456a50de60f0fbbc6c017
[2 replies] Last: Thanks, i'l be sure to start at a lower level before I go for tasks li... (by IceyEyez)
March 2013 Pages: 1234... 87
  Archived months: [feb2013] [apr2013]

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