Beginners - January 2019 (Page 3)

by kmce
Pointers
 
Hello, I am looking for some examples involving pointers, Ive been trying to get my head around them, on and off for a few months, and I believe I understand th...
[11 replies] Last: Alright, I've never encountered situations where an array wasn't decay... (by Uk Marine)
if statement working in windows but not in ubuntu
 
Hello! I have a if statement that is working in windows but does not work in ubuntu. I have tried putting a cout statement above my while loop to test it was ...
[13 replies] Last: If he outputs something after it could overwrite the previous output w... (by Peter87)
getline() glitch
 
in my sms(student management system) when i use the getline() to take full name and store in to a vector the program "glitches" i really don't know how to descr...
[5 replies] Last: yeah that really helped; thank you Dutch thank you Andy i am much grat... (by rapanomalous)
multiset, iterator and insertion
 
My college senior told me that if I make iterator to multiset and insert in the multiset it would not break the iterator. Is it true? Multiset can change value...
[4 replies] Last: set and multiset are normally implemented as binary search trees ( h... (by Peter87)
by Bopaki
error: 'conversation' was not declared in this scope
 
I cannot find what is wrong with this program, but I get the above error. //This is the definition for the class StringVar //whose values are strings. ...
[2 replies] Last: Thanks very much!!! TheIdeasMan (by Bopaki)
Randomly selecting a number from an array based on probability
 
Currently using an array with probability in a class, but i'm having troubles making a procedure that would show what number would appear based on what random n...
[4 replies] Last: Initializing at declaration is perfectly legal and should work with co... (by Grime)
by deello
How to pass vector into 2d array?
 
I have a text file with of content like this: [1,1]-3-Big_City [1,2]-3-Big_City ....etc. I have read the file and tokenize string into vector<string>. The...
[1 reply] : You can simply use push_back as you did for the string: void displayC... (by coder777)
For Loop / getline() Problem
 
I'm trying to solve this problem: https://open.kattis.com/problems/carrots In short, I don't see what I'm doing wrong with my for loop. It should ask for inp...
[4 replies] Last: @dutch Ahhh okay. I understand what you mean now. Thanks! (by PiggiesGoSqueal)
Help with showing decimal points
 
Hi I have to do this assignment where I convert KMH to MPH, and the result needs to be a decimal place. This is what I have so far. #include <iostream> ...
[2 replies] Last: Ok it works now, thanks (by ianlee521985)
Problem in swapping of array indexes
 
Hello, I am making a program in which I am supposed to solve a mathematical expression using DMAS rule.. I am supposed to take an expression in a character ar...
[5 replies] Last: Hello redfury, The following code is not pretty, but it does show som... (by Handy Andy)
Array as function parameter, the pointer increment does not count for callee
 
#include <iostream> void plusOne(int* array) { array++; std::cout << *(array) << std::endl; } int main(int argc, char *argv ) { int array = {0, ...
[2 replies] Last: > What does it mean to increment array+1 in the calling program? I me... (by CakeByTheOcean)
bit programming -> take out the bit at odd/even index
 
Assumed we have a uint16_t as 1100110011001100 How can I take out the bit at odd or even index, then return a uint8_t, since half of the input. uint16_t ...
[3 replies] Last: or think about it for a bit ;) you want to grab every other bit into a... (by jonnin)
Quick sort pivot is middle element
 
There are absolutely no resources for quicksort with the middle element as the pivot. Can anyone give me a link to learn it? My own implementations are failin...
[3 replies] Last: I can do from left or right most pivot (by closed account 1vf9z8AR)
Set char 1 = char 2. What is syntax?
 
I've been searching for this but found no examples or discussion. I'm trying to input the value to one char using the value from another, like: char i...
[4 replies] Last: Recreate strcpy() or other C-string handling functions from Standard ... (by H00G0)
Is there a string conversion function to char type?
 
Hello, I want to ask about a question that bothers me for quite a while. In C#, there are functions that convert string to other variables such as Convert.ToIn...
[6 replies] Last: Thank you Grime and jonnin for the detailed explaination regarding thi... (by structJason)
I'm having trouble with "if else" statements
 
So I'm very new to C++ and I taking a class on intro to programming and this is one of my assignments and I'm having a problem with the last part of the code wh...
[7 replies] Last: > cin>> nInput, Ucap, Lcap; I would suggest you print out those 3 vari... (by salem c)
Loop
 
Dear Friends I want to stop the following code when all entities in the error are simultaneously less than one. And if even one entity be greater than o...
[10 replies] Last: It worked well in my full code. I think the code will only break when ... (by usmannazir)
exception handling
 
I found an example from an article about exception handling, but there wasn't explained whats the meaning of 'const throw()' beyond the what() method header is....
[3 replies] Last: Note that this way of using the throw() syntax on functions has been d... (by Peter87)
Compare two unsigned 8 bit int
 
Hi I have a simple question but in a situation. How can I compare two 8 bit int a, and b, in the situation <, >, = these comparison are defined only on the sig...
[7 replies] Last: This was the OP's justification: I could use the SIMD signed compari... (by lastchance)
Swap max and the first element of the linked list (end of input 999)
 
Do i find max value without mistakes? And pls explain an how to swap elements by a given condituon #include <iostream> using namespace std; struct Nod...
[1 reply] : if the data is small (like, an integer or something) you can swap the ... (by jonnin)
January 2019 Pages: 12345... 17
  Archived months: [dec2018] [feb2019]

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