Beginners - July 2018 (Page 2)

Stopping a loop that takes an int with a letter
 
When the user enters 'q' or 'Q' I want the program to exit the loop. What confuses me with this is that I'm taking in an integer so I'm unsure of how to stop i...
[4 replies] Last: A few good concepts here I'll give each a try just to learn different ... (by passiontrip)
Kargers Min cut algorithm
 
Hi, I have been coding in C++ since in a month and not completely familiar with the errors and bugs encountered (I am a mechanical engineer). I have tried to...
[2 replies] Last: Thanks a lot for your suggestion and information! I figured out a cou... (by hasslersteph)
did i get it right?
 
i do not understand some parts of it 1)Override the Student's OutputIdentity() pure virtual method to display the text "I am a student" to the console 2)O...
[1 reply] : To override something from Student, you must first inherit from Studen... (by Repeater)
was not declared in this scope
 
what does it mean my age was not declared in scope?i thought I just needed to declare it in the header file.did I forgot to connect something that does not allo...
[2 replies] Last: Hello, shouldn't obj ( quaint name ) be a Person of type class Person ... (by mycuser)
std::filesystem C++17 ?
 
hello everybody. i'm trying to use C++17 filesystem library to open all files in a directory. #include <iostream> #include <string> #include <filesystem> in...
[3 replies] Last: oops, i understand now. i didn't realize the string method was inside... (by Stauricus)
by sc7
how to optimze this code ? (1,2)
 
Prob: Shreya is currently the top rated programmer of the college. She loves to solve problems which are based on range query. But this time she wants to chec...
[20 replies] Last: @ne555 thanks for the help in this, I have learnt a very useful data s... (by sc7)
Array Sorting
 
Hi can you help me where Am I going wrong in this code i am getting 30 pts and WA for 2 test cases; https://www.codechef.com/LOCJUL18/problems/CMK ...
[4 replies] Last: still giving WA (by closed account 3UohqMoL)
std::string vs. std::string_view
 
In both passing as a parameter, and as both a plain data type. When to use which? For the longest time I've always passed strings as a const ref: Window(cons...
[5 replies] Last: Also, boost::string_view. (by helios)
making initializer list work without parameters
 
normally I think that a constructor with an initializer list would work if there were parameters involved but I am reading the book SFML Game Development with e...
[10 replies] Last: figured it out, all had to do is specify an int in the Mercury constr... (by programmy)
Reading scandinavian letters in strings
 
Hello, I must write a program that recognise scandinavian letters. I wonder why this code does not work? (I use CLion 2018.) for (char c: rad) { ...
[2 replies] Last: Thank you, I get the principle I think... (by Dovendyr)
Validation for 2D Char Array Insertion
 
I am working on Tic Tac Toe, and I am mostly complete. This is a side program snippet of code to avoid messing up the other program, but its essentially the sam...
[2 replies] Last: #include <iostream> #include <algorithm> // UTF-8 box-drawing chara... (by tpb)
A problem with goto
 
Hello. I am having problems using goto. What I would like to do is break out of all of the nested loops a once when playerPlacement == 50. This seems like it s...
[7 replies] Last: @Manga, I didn't notice it in main, but it's also declared globally. I... (by tpb)
How to do this type of question
 
College is a major part of life, it gives you new friends life experiences and other stuff, our chef has joined as a teacher in college and he is watching the f...
[3 replies] Last: why not simply use graph for connecting and bfs to see whether they ar... (by sc7)
by thx
Type Command Equivelant
 
I was wondering if there is a "TYPE" command equivalent in C++ as there is in command line. COMMAND LINE CODE: @echo off echo TYPE Command >> example.txt type...
[1 reply] : That looks close to: http://www.gotw.ca/gotw/048.htm (by keskiverto)
Accessing arrays in a class
 
I'm new to classes and this is my first time using an array within my class. I'm trying to access my array with the print function but when I do I'm getting th...
[3 replies] Last: You do not have to make the arrays static (by Repeater)
by sh4217
Vector pointed by iterator only recognizing one data submember
 
I'm using vectors to obtain and sort a "highscore" struct that has an integer score variable and a character array name one. I use two iterators, i and j, to so...
[3 replies] Last: You have other problems, and it can be simplified: void sortData(ve... (by tpb)
my program runs but keeps on crashing afterwards:(
 
i dont know what is wrong with my program. i fixed the errors. it runs but in the middle it stopped working. it's a program for inverse matrix. please help me ...
[1 reply] : #include<string.h> #include<math.h> #include<conio.h> #include<iostr... (by Manga)
How to shift string character
 
here is my question https://www.codechef.com/LTIME62B/problems/FRCPRT
[1 reply] : That is not your question. That is your homework. (by keskiverto)
Max and Min Random Generate Number
 
My problem : My random generator keep generate 0. Anyway to fix this ? #include "stdafx.h" #include <iostream> #include <iomanip> #include <cstdlib> ...
[5 replies] Last: Here you have taken the wrong value which does not match according to ... (by shivkumar12)
by Jreyn
trying to load from file
 
So, for my homework assignment I am to: Write a C++ program that is menu-driven that allows for the following menu choices: 1.Load an exam: Loading an exa...
[2 replies] Last: tpb, Thanks for the quick reply and getting me pointed in the right d... (by Jreyn)
July 2018 Pages: 1234... 17
  Archived months: [jun2018] [aug2018]

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