Beginners - August 2019 (Page 2)

How do you use the ... operator
 
How do you do it? It super confusing to me
[2 replies] Last: Thanks! :) (by highwayman)
How to generate a vector [1, 2, 3 ..., N] efficently?
 
My question is simple here: How to generate a vector [1, 2, 3 ..., N] efficently? Any speed up idea would be okay. (SIMD?) Assume to build such a vector in run...
[6 replies] Last: > generate a vector [1, 2, 3 ..., N] > [n = N] () mutable { return n... (by ne555)
constant timestamp
 
I have a class named message and I want to be able to tag it with a timestamp, so then I can write the tag on a .txt file. Yet, I have no clue how to make the t...
[1 reply] : > how to make the timestamp constant, so it doesen't change every sing... (by ne555)
Adding a comma into calculated numbers
 
Hello everyone, I was writing some code for a C++ class, and I am curious if there is any way to add a comma into your output? For example, let's say one calcu...
[8 replies] Last: @Handy Andy, I believe that using the native locale is in many cases t... (by mbozzi)
by colt
Can't open text file, no matter what
 
Hello. I am currently trying to open a text file and being unable to do so until now. I already checked: 1)The File name. I did a copy and paste from the fil...
[4 replies] Last: Hello colt, When I tried to make the program work I found one problem... (by Handy Andy)
Can't find problem with Search function in Hash List
 
Hello, i made a List registry to store contacts, with name, city and cpf(id number), and search them by their cpf. However, the search function doesn't find ...
[3 replies] Last: This looks like C, not C++. If you're using C++ then this code could b... (by dhayden)
error: 'm_controller' was not declared in this scope
 
Hello, I am trying to add my function: void Check(void) { while(true) { Sleep(1000); bool Founded = IsPr...
[4 replies] Last: Notice all the other functions in that file look like: void xmrig::A... (by Ganado)
linker error
 
I have a large project that I am working on and when compiling I got a weird linker error and I can't pin the cause, I have managed to reproduce the error in a ...
[5 replies] Last: @coder777 that was in response to @salem c request for the actual erro... (by closed account SECMoG1T)
Explicit destructor call ==> program freeze
 
Hi all. I am using Bucky's C++ tutorials on YouTube at: (https://www.youtube.com/watch?v=mUQZ1qmKlLY&feature=youtu.be) Although it recommends using the "...
[11 replies] Last: Going off of what @jonnin said: [quote=jonnin]I mean you can still mes... (by TheToaster)
Is it possible to resize a vector using iterator
 
I want to ask if it is possible to resize on a vector itertor, in order to get such a vector resized? #include <iostream> // std::cout #include <iterato...
[2 replies] Last: *first isnt a vector, its an int. ^^^ explicitly stating what he said... (by jonnin)
Lambda Capture Block
 
Can someone please give an example as to what the difference between the following? auto lambda1 = [ this]{ /*...*/ }; auto lambda2 = [*this]{ /*...*/ ...
[1 reply] : You're exactly right. This is generally useful if you plan to change ... (by Albatross)
I have to solve this code i am not able to do please help anyone.
 
Remove alternate elements from array starting from index 0 till only one element is left in the array and display that element. Design a new number such that 0...
[6 replies] Last: i am not able to code anything. i dont know where to start. i am conf... (by George P)
Crud Program using Fibonacci numbers
 
Hello, we are supposed to write a program to find the population of crud after a certain period of time using 3 different types of loops. I will post the questi...
[4 replies] Last: Thank you! I took what you posted and modified it in mine and it works... (by XboxOne2019)
Vectors
 
I am trying to convert a given program from using c-string array and a dynamic array to a vector. The program asks the user to enter how many scores they would ...
[6 replies] Last: That makes sense now. Thank you. (by stoneJax)
by ivy414
Can you help me write program- auto pick up lotto numbers?
 
Hi, I would like to run a program that auto pick up 5 numbers from 45 (1 to 45), no duplicate number. The odd number must have higher drawn percentage. (mean th...
[12 replies] Last: Trying to write this program using the C libraries only would be a who... (by George P)
Reading eof but not eof
 
I am attempting to write a program that reads a random html file I pulled. Some reason when I attempt to read the file with the following code. while(!i...
[3 replies] Last: I am running the code in the IDE jgrasp, I assume it's like running in... (by alien51)
cin >> (pointer to char); (1,2)
 
when I cin a pointer to char, I create an array of chars. Why does this work? Is this 'undefined' behavior? Is this natural? Am I actually just #include ...
[24 replies] Last: So some things do not need to have locks because they already have har... (by highwayman)
Declaring 2d array as argument of function in .h file. (1,2)
 
Hi! How can I declare a function prototype in .h file that receives a 2d array with variable dimensions? Here what I tried. test.h // this 2d array w...
[20 replies] Last: I suppose c99 is 20 years old and going strong, though. No reason to... (by jlb)
Guessing a random number
 
i am not getting any syntax errors but it is not working properly. #include <iostream> #include <cstdlib> #include <ctime> using namespace std; i...
[5 replies] Last: Hello OhMyJosh1k, To go with what Furry Guy has said I found this v... (by Handy Andy)
Delete[] vs delete
 
if I were to call delete on a pointer where I had only called new type instead of new type , how bad would that be? int * a; a = new int; delet...
[3 replies] Last: Alright, thank you! :) (by highwayman)
August 2019 Pages: 1234... 8
  Archived months: [jul2019] [sep2019]

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