Beginners - January 2021 (Page 6)

Troubles with ifstream
 
I am not able to get my program to pull the neg/pos/nut effects out of file. I named the notepad file objects.txt and still nothing. any ideas as to why? PS: ...
[3 replies] Last: "objects.txt" is a relative file path. It is relative to the workin... (by Peter87)
why is the code not working? || srtuctures
 
hi, i'm experimenting with structures and i followed the tutorial i saw online and did exactly what it said (i think) but the code isn't working for some reason...
[3 replies] Last: Okay! I get it now, thank you so much!! :) (by laura fidarova)
If/Then Statements with char
 
I am still new to programming with C++ and I'm trying out some If/Then statements. Basically I'm trying to do something where someone enters one of the spells f...
[6 replies] Last: it was not meant to run. I clearly left off () on the if statement, h... (by jonnin)
Pixel matrix
 
Hello, when i have this: typedef unsigned char pixel ; and then pixel** fillArea (const pixel *const *const picture,size_t width, size_t height) then i have a...
[1 reply] : pseudocode pixel ** pic; pic = new pixel* ; for all the rows pic = n... (by jonnin)
Project Help
 
"You are expected to write a c++ console application which reads files from Reuters-21578 documents collection appeared on the Reuters newswire in 1987 and find...
[6 replies] Last: I do not know about the [Duplicate thread] or what has been said so f... (by seeplus)
C++: hex numbers and reference parameters
 
Hi, I'm playing with reference and pointer parameters. Problem is when i print it, it gives me only hex numbers. I want it to print as a decimals. Here is p...
[10 replies] Last: @Scorpia Your thread title and OP both mention "reference parameters".... (by MikeyBoy)
Array of String in C
 
Hello, I'd like to create array of string in C. but I have Access violation error: #include <stdio.h> #include<string.h> #include<stdlib.h> int main() { ...
[6 replies] Last: Consider: #include <stdio.h> #include <string.h> #include <stdlib.h... (by seeplus)
cin.ignore() is pausing my code reading data from a file
 
I'm trying to use cin.ignore after I use the extractor operator (>>) to read and discard the end of line character before I use a getline function to collect mo...
[8 replies] Last: An alternative take is to overload the stream extraction (operator >>)... (by seeplus)
by vdxnc0
counting number of base and derived classes pointers
 
I have to write a function to count number of pointers to objects of base class and number of pointers to objects of derived class that are stored in array. I ...
[1 reply] : class Foo{ public: virtual ~Foo() = default; }; class Bar: public... (by ne555)
a reference of type "std::string" (not const-qualified) cannot be initialized with a value of type "char"
 
Can some one please explain this error? I read about it but did not understand it enough to solve it. string filename; cout << "Enter Your Target Fil...
[14 replies] Last: As per previous. that was answered here http://www.cplusplus.com/forum... (by seeplus)
void play if statement not working | login/register system
 
Hi there, so when you run this code it shows me all the possible options for the if statement at the void play(), why is it doing that ? #include <iostre...
[6 replies] Last: Hello lazylife, While working up a response I see that seeplus has ... (by Handy Andy)
by Drayt
Login/Register Problem
 
I'm trying to make a program that gets input from the user and enters it in the "accinfo".txt, basically a register/login program. but i'm getting problems. Whe...
[6 replies] Last: I understand now, Thanks. (by Drayt)
compares
 
...
[3 replies] Last: What is the basis of the compare? By line, by word? This can be done s... (by seeplus)
by siid14
C-String : incompatibility between char and const char *
 
I'm doing a code with only C-String. This code is about to check if the password that the user input is correct in the following format: mmmDDYY.fl mmm - three...
[8 replies] Last: > In the example from cppreference I tried to output the character c a... (by JLBorges)
I have studied C++ here for over 60 hours.
 
Hello,everybody here. I am a newbie in programming and I only use this website for my learning resource. Now I have studied C++ here for over 60 hours on my o...
[1 reply] : When you create a cylinder, the cylinder's constructor DOES construct ... (by lastchance)
structure and arguement
 
I have to write a program that takes a person's name as arguement and prints out all of the information about said person. I wrote a code to do this but it's ...
[3 replies] Last: #include <iostream> #include <string> using namespace std; struct ... (by lastchance)
Incrementing
 
I'm trying to increment students by 1, but each time it shows output it says "Student 1..." again and again. #include <iostream> using namespace std; int...
[3 replies] Last: Hello Awak3nDreams, Given these lines of code and considering the res... (by Handy Andy)
array
 
What do i do about this #include <iostream> using namespace std; int main() { int Array ; int i, n, d; cout<<"_ _ _ _ _ _ _ _ _ _ The Numb...
[4 replies] Last: #include <iostream> int constexpr sz = 20; int main() { int input... (by mbozzi)
by maple
const_iterator
 
Write your question here. hello, everyone, I would like to know why passing a const_iterator to an iterator parameter of a function does not cause errors in co...
[6 replies] Last: Thanks JLBorges. Now I get it. (by maple)
temporary objects?
 
How do you know when temporary objects are created? For instance I was reading a webpage that said when you are creating a new string, for instance called newSt...
[3 replies] Last: > I have found somewhere else that says when an expression such as a =... (by JLBorges)
January 2021 Pages: 1... 45678... 11
  Archived months: [dec2020] [feb2021]

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