Beginners - November 2017 (Page 3)

by ebba
Recursion- counting numbers- homework
 
hi guys! its supposed to do this: 4. Recursion. Write a recursive function called digits that will return the number of digits in its parameter of type long....
[2 replies] Last: the problem is each time digits gets called it sets count to a garbage... (by adam2016)
by cash
Convert to C++
 
Can anyone convert this python code to c++. from math import exp, expm1 import os #define variables: #define functions: def get_number(one_line): ...
[no replies]
Comparing string content?
 
I'm expecting my if statement to comparing two strings but for a palindrome. If you type madam for example the if statement doesnt see its the same in reverse? ...
[3 replies] Last: Try going through it mentally on a short string, say "abc". a is index... (by Ganado)
Error With Double Definitions Resulting from a Struct
 
Hello, I've recently been doing a modified version of my previous address book, but in a more simplified version. I have gotten the program to work when in one ...
[1 reply] : You shall not define variables within headers. If global variables are... (by coder777)
Accessing class member variables from Main?
 
Hello everyone, Assuming i have a class Student that have the following member variables: private: vector<Objects> My_Object; an Object can be a pen, a p...
[3 replies] Last: whatever you're trying to do in main() with each element of that priva... (by John87Connor)
Unhandled execption error!
 
I am writing a monogram program that allows user to enter full name (first, middle, and last name). The program will get all three initials of each name and put...
[1 reply] : Nevermind, i found the error. I needed this line of code at the bottom... (by mickeraiello)
OOP: Is this polymorphism?
 
My lack of trying to understand these concepts. - the use of the virtual keyword - l've heard is more common to use pointers when manipulating classes - al...
[7 replies] Last: @keskiverto thanks for the effort. lm really understand every part of ... (by vincentthorpe)
by Bopaki
I have been battling with this project since from Monday. I do not know why I get these 5 errors
 
I am getting this error when compiling my program: Compiling C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp... C:\Dev-Cpp\Chapter5\Today\LlistType\ordered...
[2 replies] Last: here it is #ifndef LINKEDLIST_H #define LINKEDLIST_H #include<iostre... (by Bopaki)
by cash
Convert to C++
 
Can anyone convert this code to a program that uses namespace std and iostream and fstream header files. import filestore import time import datetime d...
[1 reply] : Is it Python? Before doing any work, have you already tested if it wok... (by Enoizat)
Skipping an input field
 
HI there, I'm currently learning classes within C++ at university and I'm writing a small program that just allows users to type in values for a weapon and t...
[1 reply] : getline allows you only to read strings and nothing else. getline(ci... (by Thomas1965)
2D array of vectors
 
Hi guys, can someone give me an easy to understand way on how to do this? I have N² 2d vectors and I would like to store them in a N x N-array. So, mathem...
[16 replies] Last: there are 2 ways to implement NxN matrices: 1. you use a container th... (by John87Connor)
Help understanding operator overloading?
 
Im having a really hard time understanding how this section of code works. I get everything in the program besides the adding part and it seems no matter how m...
[1 reply] : Operator overloading is not much different from regular function overl... (by Peter87)
Calling function in main()
 
In this code I've written two functions, which I both call from main(). However, I'm stuck when calling playGame() on line 16. How do I pass the pointer of the ...
[2 replies] Last: How do I pass the pointer of the array if it isn't defined or declare... (by Chervil)
How can I enter data into a struct after I pass by ref to a function?
 
Hello, I am trying to enter data into a data structure after passing it by ref to a function. When I use a for loop to refer to the specific struct index, I...
[4 replies] Last: Glad it works. Indeed, raw arrays are an exception to what might be in... (by Ganado)
Combat Between 2 Characters using Classes
 
How exactly can I modify the healthpoints of my two characters (mHealthPoints and mHealthPoints1)? I get syntax error for putting mHealhPoints under the Goblin ...
[1 reply] : your character class (the base class?) should have a value for current... (by jonnin)
Broken code for arrays
 
Hello, Could you please help me in fixing my broken code? I need my code to accept negative numbers and doubles. It also has to show both arrays listed ne...
[11 replies] Last: Hello sr2cute702, This is your code with comments. I will not say tha... (by Handy Andy)
Search value in a map with user input
 
Hi, y'all! I'm stuck with the following problem: I want to get the name of an employee by user input and then put in structure, but I can't figure out how to do...
[1 reply] : replace const char* with std::string as the key-value-type in the map<... (by John87Connor)
i need help again :)))
 
please tell me why it does not work int x,y,c,n; cout<<"x="; cin>>x; n=0; while(x!=0) {x=y;c=0; while(y>0){if(y%10>c) c=y%10 ;y=y/1...
[2 replies] Last: Hello queen13, This should give yo an idea of what your program is do... (by Handy Andy)
c++ coding killing me to much to understand
 
I wrote the following code in vs2005 now i am translating it to vs2017 I cant figure it out. The problem is string String *binn; strcpy (drive1, drive ...
[4 replies] Last: sorry i meant just a string "110111101110011010110111011001" of 31 ch... (by nickhere)
Longest Matched Substring confusion / clarification
 
This is more of a "can you help clarify?" ~ the below is the full assignment I was handed, with no additional explanation. ----------- Consider two strings ...
[2 replies] Last: @meegsees, You can do it recursively. Consider just the forward direc... (by lastchance)
November 2017 Pages: 12345... 33
  Archived months: [oct2017] [dec2017]

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