Beginners - December 2019 (Page 3)

My find-replace function is broken
 
6. Write a find-and-replace operation for Documents based on ยง20.6.2. I've tried to make a find and replace function but it doesn't work. Here's the full code...
[5 replies] Last: @johndoeisabro, Your code fails whether you call your find and replace... (by lastchance)
What is the asterisk in class Department in the private access specifier after the Teacher for?
 
at line 22. #include <iostream> #include <string> #include <vector> class Teacher { private: std::string m_name; public: Teacher(std::st...
[5 replies] Last: By default a std::vector stores its data on the heap. Instead of ma... (by George P)
What's the pmr namespace?
 
Very often when I browse through the c++ reference, I register that some stuff is in the namespace pmr. I searched for an explanation of this but didn't found s...
[8 replies] Last: A polymorphic_allocator is just a facade that makes a pointer to a... (by mbozzi)
Variable help
 
Hello everyone. I need help with a variable.Here is my code. For some reason the string variable isn't working when i type the correct answer. I think it's beca...
[4 replies] Last: Worked. Thanks a lot! Appreciate it. (by Mariyan)
by KaramA
New to C++ need some help with a time conversion question
 
My assignment has the question "Create a program that will ask users for a 12-hour time, then shows the time in 24-hour form: Enter a 12 hour-time: 9:11 PM Equi...
[2 replies] Last: #include <iostream> #include <iomanip> #include <string> #include <cc... (by lastchance)
by asxxx
Write/Read text file
 
Hi, I want to create a program which let me write to text file and read from this text file. I have problem with second part of this exercise. #include <...
[3 replies] Last: http://man7.org/linux/man-pages/man3/fgets.3p.html Because while ( fg... (by salem c)
String concatenation in C
 
Hello, I want to concatenate two string in C. could you please tell me where is my problem? Thanks #include<stdio.h> int mystrlen(char *str) { ...
[3 replies] Last: The end condition in the loop in mystrlen is wacky, too. x and y in ma... (by dutch)
std::length_error at memory location
 
I have a problem which I just can't figure it out. It happens in case 2 "Check info about a student". When the program is launched and first a group of students...
[4 replies] Last: Thank you! It is now working. (by Nedrozak)
Implementing user defined adjacency list(directed)
 
Hello everyone! I am trying to implement this but it's not printing the result. Please help! I am calling gh.printgraph but its not printing #include <iostre...
[3 replies] Last: adjlistnode* tmp = array .head; Now take a good look at this line.... (by Repeater)
by flav32
N Queens not printing all solutions
 
My code works well but it only prints one solution. What should I do so I get all the solutions? #include <iostream> #define N 4 using namespace std; v...
[3 replies] Last: Thanks! (by flav32)
How to capture the URL
 
I am trying to figure out if there is a way to copy the URL of a website automatically and store it in a .txt file using C++ or if that would be a Java Script s...
[14 replies] Last: The OpenDNS solution I linked to above is free and simple to set up an... (by dutch)
by kmce
Private variables and errors with methods
 
Hi, I am trying to get some practice with creating classes in headers and cpp files, and having some issues. My first issue is setting the private name and id v...
[2 replies] Last: Most of what you have is OK. the main problem is lines 43 44 and 68. I... (by againtry)
typedef boolean (*Item_Function)();
 
What does this mean? any help is much appreciated thank you typedef boolean (*Item_Function)();
[4 replies] Last: It need not be complicated; the type alias can be declared using synta... (by JLBorges)
Unrecognized << operator overload
 
Problem Statement: I'm working through the Towers of Hanoi puzzle. In creating the Game class, I'm using an overloaded << operator to output the contents of th...
[5 replies] Last: This is where it helps to slow down, and take the time to read the err... (by MikeyBoy)
HEEELP
 
Create an application that uses the structure Item with fields: brand name, price, code. Create an array of such items from 10 items filled from the keyboard. Y...
[1 reply] : Hello skorpas, The first question you raise, is this a C or C++ progr... (by Handy Andy)
comparing strings
 
I need some help comparing 2 strings so if in a file there is the string ex: "hello world" and them the user inputs a string I need the program to tell me if t...
[4 replies] Last: @ Ganado Yup the getline was the problem I have it working perfectly n... (by Ripb123)
seperate and read a txt file
 
This is txt file 1P -------------------> class name 4 ---------------------> number of students Catlin HENDERSON 100 Tessy BARNETT 101 Toma RICE 102 Ado...
[8 replies] Last: which corresponds to the number of lines in your file before the next... (by jonnin)
Accessing any element on a list stl c++
 
How do i access a part of the list if there's no initial value ? This is the program I'm working with: #include <iostream> #include <string> #include ...
[4 replies] Last: Hello kramsuiluj, Yes it could be done, but it is more work than you ... (by Handy Andy)
by ICantC
Placement new
 
Quick question regarding placement new, i'm trying to make a very simple vector however i'm struggling to understand how I assign an item to a particular index ...
[7 replies] Last: Remember that arrays are zero-indexed. So, if you have 1 element in t... (by MikeyBoy)
Visual studio 2015 unresolved external symbol
 
in my project, I have A.cpp and B.cpp, A.cpp call public function from B.cpp eg: //B.cpp class B{ public: void msg(); } //A.cpp void msg_...
[10 replies] Last: Hello kakaducsy, It has been a long time since I have done this, but ... (by Handy Andy)
December 2019 Pages: 12345... 13
  Archived months: [nov2019] [jan2020]

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