Beginners - June 2017 (Page 12)

help to understand code recursive string
 
#include <stdio.h> #define SIZE 80 void reverse(const char * const sPtr); int main(void) { char sentence ; // create char array puts("Enter a line of...
[3 replies] Last: It may be easier to understand by changing the output of reverse() to ... (by dhayden)
by Pete8
semi-colon / closed bracket error !?!
 
I'm encountering a problem involving an integer named __asm__. I declared it: int __asm__; but then see build errors related to a missing semi-colon and clos...
[5 replies] Last: "wmic cpu get ProcessorId" certainly isn't a command recognized on my... (by lastchance)
Find balanced BST with max height
 
Hi to all! I am trying to get the hang of BSTs and I am wondering whether there is a universally accepted way of searching a BST for a balanced subtree with ...
[1 reply] : Seems the same post as in http://www.dreamincode.net/forums/topic/4044... (by Thomas1965)
Simple function and template question
 
Hi, Can somebody explain the line below.. Especially the &d part void copyFrom(const DateClass &d) and (template) k = sum<int> (i,j); Ple...
[2 replies] Last: @OP, below is just a simplified version of the use of template. #incl... (by chicofeo)
by Dagr
Data Class
 
Hi guyz. I need class which defines is it or not Leap year. The main idea is that year must choose user. So if u have some ideas please help me
[2 replies] Last: Thanks (by Dagr)
project .exe file is not recognized as an iternal or external command?
 
To be fair, I don't know what exactly is going wrong here, but the information I can provide is two things: I was following a tutorial, which had me create a wi...
[4 replies] Last: @Handy Andy So I don't know what I did differently, but I did make ano... (by moosyman)
How can I check if the libraries exist on my computer?
 
I try to make a small code example: https://github.com/PointCloudLibrary/pcl/tree/master/doc/tutorials/content/sources/qt_visualizer When I run cmake it doe...
[1 reply] : the -l flag look for libraries in a stndar list of directories, like... (by ne555)
by xxvms
Not sure...
 
Hi there I am not sure if I should be using delete , at the end of main. I am creating new dynamic object with use of new, but this is stored in an array. S...
[3 replies] Last: the destructor of `Publication' should be virtual virtual ~Publicatio... (by ne555)
Can't delete a Node from the Binary Search Tree
 
My header file #include <iostream> #include <string> using namespace std; class BinaryTree { private: class btNode { public: int key; b...
[1 reply] : The node pointer being passed into the delete function is called btPtr... (by wildblue)
Issue with push_back
 
Hello, I'm new both to this forum and C++. I hope someday I can contribute here somehow, but for now I'm asking for help. So I'm making a program which is a ...
[3 replies] Last: If you planned to save your data into a database, those pointers would... (by Enoizat)
Binary tree confusion?
 
Hi guys I first of all want to apologize for posting this code in java not c++,I am very short on time but when I get a chance I will edit it and turn it into c...
[3 replies] Last: but insert returns newNode? No, insert usually returns tree at line ... (by dhayden)
For While Loop
 
Hi all, I'm working on a program that manages sales for a store and completing sales. I have a working for...while loop, however, I am attempting something ...
[3 replies] Last: I did not post all of my code, but I have all of my variables declared... (by DCommander72)
Code compiles in main.cpp, but not in header.
 
If I paste this code into my main.cpp it'll compile and do what it's supposed to do just fine. If I put it in a header, I get an error on the third line that s...
[1 reply] : Example 1 (correct): #ifndef NAME #define NAME #include <iostream>... (by Enoizat)
by alx119
Problems after pushing back into the vector
 
Hi, I'm trying to simulate a particle generator with c++ and opengl. I have a class for emitter and a class for particle. I have a code here where I want to ...
[2 replies] Last: Hi, Thank you for your reply. I found what was the problem. In the co... (by alx119)
Help me please !
 
Give the range of integers. Find and print absolute values ​​of the two numbers with the least difference. Input format: The first line is N - the number...
[10 replies] Last: If they are known to be in ascending order then it should be possible... (by Enoizat)
by xxvms
TypeID
 
Hi there I am running this example from book and there is something I don't understand Output of this program should be pointer to an object of: Deriv...
[3 replies] Last: The 8 stems from a concept known as name mangling: https://en.wikiped... (by coder777)
by xxvms
Define both copy constructors and Assignment Operator
 
hi there :) I need fact check if this is makes sense ( I think it does but .....) ".... when you overload the assignment operator, you must always want to...
[5 replies] Last: Hmm, copy ctor is a ctor too and constructs one more object ... You ... (by Thomas1965)
Average function is not working.
 
My average and total in getaverage is always 3276. I have everything else working. Can you help me figure out why it is doing this? #include <iostream> ...
[3 replies] Last: Hints: #include <iostream> using namespace std; int getgrades() { ... (by Enoizat)
class
 
For number 1 and 2 : class Rectangle { int width, height; public: Rectangle (); Rectangle (int,int); int area (void) {return (width*h...
[1 reply] : Hi, 1. No difference, it just means the function does not accept argu... (by TheIdeasMan)
by darje
Linked list
 
looking for a source of codes or some information if someone can share with me . iam having a diffcults time to understanding this subject. tnx alot for help ...
[1 reply] : First you should not use Linked List, unless you really have to. https... (by Thomas1965)
June 2017 Pages: 1... 1011121314... 16
  Archived months: [may2017] [jul2017]

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