Beginners - November 2021 (Page 2)

Trying to take 2 vectors from 1 file and write into 2 seperate files
 
Hey guys. So I was trying to do a programming project where I take the most popular boy and girl baby names and save the data into 2 vectors. I was then suppose...
[8 replies] Last: #include <iostream> #include <fstream> #include <string> #include <ve... (by JLBorges)
How to stop program from running a statement twice
 
Hello all. I am writing a program that converts Fahrenheit to Celsius, then after it converts, asks the user if they would like convert another temp until th...
[4 replies] Last: Got it. Thanks so much for the help and advice! (by Brownbear951)
by janac
cin behavior
 
I notice that if cin is assigning input to a float, if there's a typo at the end, it stops at the last character that makes sense. float number = 0; ...
[1 reply] : > Is this behavior standard? Yes. Formatted input is handled as f... (by JLBorges)
The Heap
 
Why is it that we do an increase with totalNR when we do addition of new elements into the heap while we do not do so while going through the elements of this s...
[1 reply] : "data" presumably has "long" possible elements. To add NEW data, you w... (by zapshe)
by janac
Is range-based loop identical to for loop?
 
The code below works correctly. It checks for the letter 'd'. Iterations stop if the word has a 'd' in it. My question is, does this mean that behind the range...
[3 replies] Last: Thanks for the details, I don't pay enough attention to them. (by janac)
Please help me on how to add two IEEE numbers
 
I am doing a practice on the IEEE 754 operations that has an inclusion of addition. My big target is to make a code that will run them, but I have to start by u...
[1 reply] : the exponents are shifted by a constant depending on what format you h... (by jonnin)
Const array accessing.
 
Hey there, In my source file I got the following definition: const char *TASK_TAGS = { "Flash", "HttpServer", "I2dApp", "Iob", "Wifi", }; and it has a decla...
[1 reply] : Don't overdo it with the unnecessary pointers. const char TASK_TAG... (by jonnin)
Generation of arrays that have certain repeat.
 
Hey With me is a question that am requesting to be answered. Am interesting in making an addition of numbers between 1 and 10 by ensuring that each number is r...
[1 reply] : To ensure that each number is repeated twice, add each number twice. F... (by JLBorges)
Input is either odd or even display
 
With me is a program that makes it possible for the user to make an entry of many integers as they feel like. These integers are either positive or negative. Af...
[no replies]
Previous functions repeated with reception of certain signals.
 
Hi guys, An interested in finding a way that I can do repletion of a previously called function when the signals of the infrared remote are received. Any mome...
[1 reply] : enum command { REPEAT, ADVANCE, LEFT, NOP /* etc. */ } ; void do_tic... (by JLBorges)
Using pointers to find a subset of size k of a linked list of size n
 
I am trying to find a subset of a linked list using pointers. I have tried using recursion to do it, but it's not really working. For example, if I have a l...
[4 replies] Last: #include <iostream> #include <list> using namespace std; int main() ... (by lastchance)
Get information from text file randomly
 
I am writing a book systrm management code, I adding new systems, I want to add random book reccommender. But I dont know how can get book's informations with b...
[1 reply] : Not enough information. You haven't explained how you store the book ... (by AbstractionAnon)
Error with the algorithm for finding prime numbers
 
I want to find all the prime numbers in the given numbers, but I can't. For example 8 3 4 5 7 9 -9 -7 0 the output should be 4 and I have 5 #in...
[1 reply] : okm i got it, i will try it now (by closed account zbfzwbRD)
Trouble when load file from txt
 
So yeah, I have asked about this before, this time I manage to create a save file, load the setting of the game but some how I am struggling with loadding the p...
[5 replies] Last: Thanks, I finally did it. I really appreciate your help! (by merlinf)
Is this a declaration of function
 
For long time I see seniors in my company write std::vector<int> list(); // instantiate vector to instantiate a vector. But recently I read some articl...
[13 replies] Last: @waschbaerYOYO, try this with your compiler. #include <vector> int m... (by lastchance)
by larryl
Function Variable Persistence?
 
I'm not a newbie, but I'm hazy about how this works. std::string return_msg_cpp() { std::string str("hello"); return str; } Called with:...
[5 replies] Last: n3055 is pre-C++17. C++17 further refined the notion of prvalue expr... (by JLBorges)
Replacing the Pixels from one bmp file to another
 
Hey Am interesting in copying a pixel from a bmp file located in this link https://imgur.com/la1frjx and move it into the bmp located in https://imgur.com/iwN...
[4 replies] Last: See if this helps. Its GDI+ library (built into visual studio, ready ... (by jonnin)
by jabeh
Linked List
 
100 Mary 110 John 111 David 112 Sofia 121 Maria 144 Mia Lets say given above is the user.txt file and i want make a function to read all these data usin...
[10 replies] Last: It's to do really with placement of the first node, depending on wheth... (by lastchance)
The functions.
 
Hi everybody Am a new student in c++ and am really interested to know a lot in this computer science programing language. In my class, we recently had a clas...
[2 replies] Last: As a refactored starter, consider (not tried as no file test data prov... (by seeplus)
trying to understand functions
 
Can someone please tell me what I did wrong? my program won't solve for the answers. It's my first program using functions. Here's the problem with the program...
[13 replies] Last: Thank you and again I apologize. (by loner123)
November 2021 Pages: 1234... 8
  Archived months: [oct2021] [dec2021]

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