Beginners - March 2017 (Page 29)

I need help
 
From the keyboard is introduced a string of natural numbers until the value 0.The problem asks to display all of the triples of consecutive introduced numbers(e...
[1 reply] : I am here just to note few things: 1. In your problem's definition it ... (by bokisof)
Class average help
 
I am in an intro to c++ class. I am being asked to calculate the average GPA from a text file. The text file is 2 columns: the first is the class (freshman, sop...
[3 replies] Last: I think I see what I was doing wrong. I'll try this out when I get to ... (by ashugan)
by harock
I need help about nested loops
 
Hi m new on c++ i want this user supplies the height any one help me ? sorry my english is not good here s picture and answer but i cant unerstand any one giv...
[2 replies] Last: Thank you mate i already made it here s mine #include <iostream> usin... (by harock)
Finding prime factors of a number
 
Trying to find the prime factors of a number, I am having issues though with the returning of true and false. For example: When I enter the number 10 it ret...
[9 replies] Last: Try this. Only gets the unique prime factors, not multiples of them ... (by closed account 48T7M4Gy)
Beginner A* Code with an error
 
I have started programming, and I tried doing a path finding algorithm. (The drawPath is an auxiliary function to be able to see the path found.) There seems to...
[3 replies] Last: @shahfrid open your own thread for your question. Please read: Welcome... (by joe864864)
Linked Lists
 
Hi, I'm having trouble with my assignment.. I know how to add a node at the end of the lists, but I can't see the way to add a node at any space where I wa...
[3 replies] Last: Here is code to insert at position N using a slightly different list. ... (by dhayden)
Class declaration
 
Why is it that I can declare an object of a parent class as a function or as a variable but not the same as a sub-class. The sub-class can only be declared as a...
[4 replies] Last: [quote=gunnerfunner]you can declare objects with () though it's not re... (by MikeyBoy)
Half life program
 
Carbon-14 is constantly produced in Earth’s upper atmosphere due to interactions between cosmic rays and nitrogen, and is found in all plants and animals. A...
[4 replies] Last: Hint: #include <iostream> int main() { double decay_rate = .012/... (by closed account 48T7M4Gy)
delete pointer argument in functions
 
I would like to ask you something that I think it could be considered a bad practice. Let's think of a function which takes a pointer of type 'MyType' as an...
[8 replies] Last: Hi everyone! Thanks for your answers. MickeyBoy, yes you are right. I... (by hebrerillo)
Pass by Pointer
 
Hello programmers, The code below is a function to find the first '1' in an array. i think the ptr in firstOne() does not pass to main() and it says p in main(...
[4 replies] Last: I assume you already know to use #include <iostream> and using namespa... (by Kourosh23)
this keyword and address object for operator=
 
I don't understand this part of the below code: if (this != &that) { //not checking self this->~Test(); } Why do we write check for thi...
[2 replies] Last: @mbozzi, I think we do not need perator& since it is operator= , but y... (by Kourosh23)
for_each algorithm causing error
 
I cannot figure out why I get this error Severity Code Description Project File Line Suppression State Error C2664 'void (std::set<std::string,std::less<_Kty>...
[2 replies] Last: that worked, and makes complete sense. thanks (by SkarFaceT9)
Errors while removing node from list
 
I am writing a program that appends values to a linked list and removes a particular value from the linked list. The append function works. But the remove fu...
[2 replies] Last: I have rewritten the deleteNode function But this doesn't work. Here'... (by gopinathpc)
sum of a series of squares of squares
 
I am trying to get the result of this formula.. 1 + (x)2 + (x)4 + (x)6 + ..... how can i get the square to power 4 and so on? please help #include <iostrea...
[10 replies] Last: Hello everyone... Thanks to all of you i g... (by learner47)
by mlm27
How to manage <map> iterators from an external iterator
 
Hi everyone, I have <map> container where I associate a string (a word) with an object of the class NodoIndice (NodoIndice.h). I'm able to insert all data w...
[1 reply] : the string leerPalabra(); method is ill-defined. it doesn't state on... (by gunnerfunner)
no matching for function call
 
Write your question here. this is from a c++ example in a c++ text book in h file class Employee { public: Employee( std::string, std::string, double...
[4 replies] Last: @Enoizat, I try hard, but my keyboard sometimes does not work well an... (by Handy Andy)
Linked Lists
 
I'm trying to make a function that inserts a node where I want. This is the form of the function: add(char *name, int ent). If I assign 3 to ent, the name...
[1 reply] : OP: dhayden's quote from here: http://www.cplusplus.com/forum/beginner... (by gunnerfunner)
How do these string functions wrok
 
I'm trying to find the number of times "the" occurs in the file. I'm using the .find function but when I don't use "!" in the if statement it gives me the numbe...
[1 reply] : If you have read in each word as a <string> then the test is if(word ... (by closed account 48T7M4Gy)
[HW] - Reading/Parsing a .txt file into an array
 
This is HW -- I am having a problem parsing a line from a .txt file into 2 separate arrays. This is the sample .txt file with data: Aquaman,51,58,42,69,25 D...
[1 reply] : #include <iostream> #include <fstream> #include <string> #include <s... (by gunnerfunner)
Replacing four letter words with 'love'
 
This is homework- I have to use C-strings and in this code I need to replace all four letter words with the word love. My original idea was to perform a check t...
[16 replies] Last: Yep, there's no point checking unused stuff: int i = 0; int ... (by closed account 48T7M4Gy)
March 2017 Pages: 1... 2728293031... 36
  Archived months: [feb2017] [apr2017]

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