Beginners - January 2020 (Page 6)

Array Assistance (1,2)
 
I have this array program, I need some help with reading in. Per instruction my program should handle up to 100 numbers. But there are 80 in the file( I have to...
[32 replies] Last: The second block of code above looks right, assuming counter is size o... (by jonnin)
I can't find what's wrong
 
#include <iostream> using namespace std; void welstudent() { cout << "Welcome to University Dear Students"<<endl; } int calfee(int nofc); int calgpa(int gp...
[4 replies] Last: Hello Usama911, The beginning of the program now looks like this: #... (by Handy Andy)
by newGrl
remove duplicates and shift to left
 
Hello, I'm working on a program for school and I'm a bit stuck. I read through a bunch of similar posts and couldn't find the answer. I'm not sure what I'm do...
[3 replies] Last: One could cheat^H^H^H use the "easy way" and implement the remove with... (by keskiverto)
by ema897
putback line
 
is there a method to put back line after a getline(file, line), like putback(char)? I mean, I want to read 2 times the same line. first time to check if las...
[5 replies] Last: > I still don't think you need to read any line from the file twice. ... (by JLBorges)
validating different input types
 
Currently writing a switch menu system and I'm looking into validating each input that the user enters against its datatype: char, string, int, double, float...
[3 replies] Last: infatuating (by againtry)
by bsmith
How to count a new line
 
I am writing a program for a class in which I need to scan a text document for a word, insert the word into an array, then later organize the array alphabetical...
[2 replies] Last: I am writing a program for a class in which I need to scan a text doc... (by Enoizat)
by bsmith
cstrings and how to use them question
 
Hello all. I'm working on a project for a beginner c++ class. I'm tasked with taking a text file, finding each unique word, and outputting those words in ASCII ...
[5 replies] Last: How do I extract just one word from a cstring array?? You don't need... (by jonnin)
get pixel color values from image.png
 
1. how can i link to an image that's on desktop? write a path to it or include it into my project somehow? 2. how to get rgb values from a pixel of that image...
[4 replies] Last: thanks, i know really basics of c++ and made some game prototypes with... (by darlock)
std::move for pointer?
 
I came across some strange code while reading a textbook (C++ Templates: The Complete Guide 2e) today that doesn't exactly make sense to me. template<ty...
[5 replies] Last: So the initializer list constructor would make a copy anyway? Then w... (by mbozzi)
by ema897
segmention fault with pointers (1,2)
 
I received error for bad practice with pointers: that's my code class Component { public: Component(); virtual ~Component(); void logicFun...
[26 replies] Last: Clones -> http://www.cplusplus.com/forum/beginner/267366/ (by salem c)
by nonso
error
 
I have again the problem. Please, help me. Component.h #include <stdlib.h> #include <vector> #include <string> #include <fstream> #include <string.h>...
[11 replies] Last: Like I said, fix all these things before trying to run the code. $ g... (by salem c)
Reverse Diagnal of matrices
 
Write a C++ program that inputs a square matrix and reverse the contents of its diagonal values. Example {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} o...
[2 replies] Last: All good programs start with a plan, maybe circle the elements, maybe ... (by againtry)
function call trouble
 
I'm prepping for class. Brand new to this. Trying to do a basic fucntion decleration, function call, and function definition. program is suppose to enter a p...
[6 replies] Last: Well done for finding it through your own efforts and not just copying... (by againtry)
Wondering what kind of data structure to use for a project (1,2)
 
Hello, I am getting back into programming after many years off the grid. I am a cook and I want to make a program that stores and retrieves food pairings. ...
[25 replies] Last: I think I should make more typos Perhaps not. The siren was for Coo... (by againtry)
by ema897
minimum and maximum path
 
Hi! I have an oriented graph made with class myClass{ public: myClass* left(){return a;} myClass* right(){return b;} protected: private: myC...
[2 replies] Last: Sorry, but I don't understand how to adapt the code to mine (by ema897)
input problem
 
I want to take iser input of two numbers sepperated by a "/"
[2 replies] Last: yabi, DO NOT delete your posts. It is solved for you, but not for any... (by George P)
Repeating methods
 
Guys i have question how i can start methods from beginning once again when 1 variable gets value of true. For example I have 4 methods in main like this: ...
[1 reply] : Use a loop . http://www.cplusplus.com/doc/tutorial/control/ You need... (by Ganado)
Confusion about static
 
Hi, I'm gonna keep it short and straightforward because I'm sure I'm missing something really obvious and also I have plenty of more advanced stuff to learn bu...
[6 replies] Last: Yea I get it now, all I needed was some sleep haha, thanks for the ans... (by lekfanda)
by abs361
Type Conversion issue
 
Hello. I am trying to write a polynomial class that will implement basic polynomial addition, subtraction, and multiplication using input from the user. Right n...
[4 replies] Last: Maybe reconsider the name of the parameter in Polynomial& Polynomial... (by mbozzi)
by ema897
file reading
 
If have a line: (.a=m, .b=x,.c=o) how to extract each token ignoring space, not knowing how long is the line? Moreover, I have to check if there are stra...
[1 reply] : See: http://www.cplusplus.com/reference/cstring/strtok/?kw=strtok The... (by againtry)
January 2020 Pages: 1... 45678... 12
  Archived months: [dec2019] [feb2020]

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