Beginners - December 2020 (Page 4)

by kmce
std::tie ?
 
I am learning about tuples and have came across std::tie, and I just can not figure out the reason for it. Could someone explain the point in it? Is it just so ...
[1 reply] : std::tie creates a tuple containing lvalue reference s. Because t... (by JLBorges)
== or =?
 
== is an equality test. It returns either true (1) or false(0). = is assignment. The value of the left becomes the value of the right. int a = 6; // an assi...
[3 replies] Last: Please stop feeding the trolls. A question that retarded is probably n... (by dutch)
by Cintru
Trouble with strings
 
Hello, im having a problem with a program. Im supposed to write a code where a user inputs a word (doesnt need to be a real word) and i need to make a function(...
[5 replies] Last: For the second part, consider: #include <iostream> #include <cctype... (by seeplus)
by Elon C
How to deal with Segment Fault __dynamic_cast () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 
I was doing a demo of Omnet++. I met this Segment Fault and had no idea about it. #include "include\sdn.h" #include <stdlib.h> #include <stdio....
[4 replies] Last: Segment Fault __dynamic_cast There is no usage of dynamic_cast in ... (by seeplus)
why this code show unexpected answer?
 
what is the wrong in this code? when i input twelve 1 then it show 66 but why? #include <iostream> using namespace std; int main() { try { ...
[2 replies] Last: Thanks! i get the answer. I use a break in loop & it's solved (by drhunter)
question about char* name[]
 
umm, for char* name , what are all the ways to define them during initialization? I'm trying to char* name = "Something"; , but ale is saying it's inval...
[3 replies] Last: @Brainspell. It depends upon what you want. I thought you wanted to in... (by seeplus)
Two Player C++ BattleShip game
 
Im coding a battleship game in C++ and Im confused where on where to start. I typed up a pseudocode for the game. Where is the best place to start? Should I cha...
[2 replies] Last: How will you represent the board itself? Nail that down. Note that t... (by dhayden)
constexpr question?
 
Hello, I have just started to learn about constexpr. I found code online for a function using constexpr so I copied it (first code shown below) but my VS was gi...
[2 replies] Last: MS writes in https://docs.microsoft.com/en-us/cpp/cpp/constexpr-cpp?vi... (by keskiverto)
Error: no match for operator=
 
I want to initialize a hash table but I keep getting an error. How do i properly access elements from HashTables? //HashTable struct struct HashTable { ...
[4 replies] Last: Consider: //Condition struct struct Condition { string conditionNa... (by seeplus)
Pow Function
 
I am trying to make a calculator code using switch statements. There are many different arithmetic operators but when I use the pow function with integer number...
[2 replies] Last: #include <iostream> #include <cmath> int main() { std::cout << "... (by JLBorges)
2nd update on vehicle registration fee
 
My previous post, http://cplusplus.com/forum/beginner/274895/ opened my eyes up on some of the code I was writing. I have come up with a new code: #incl...
[14 replies] Last: #include <iostream> #include <string> #include <fstream> using name... (by againtry)
I need help with string
 
Well, recently I came back to C plus plus, and I was so confused when I started using it again. Anyways, I need to write a program in which the user enters a si...
[2 replies] Last: I see, I'll try it out (by Benduka2)
compilation of 2 games, 1 simple grocery and a grading system.
 
How can I execute all the program one by one by choosing them in sub menu under the main menu. That's my problem. But I already put the codes here. here's my...
[2 replies] Last: Hello CStudet, I have worked on your program a little and came up wit... (by Handy Andy)
Reading Text File and Appending (1,2,3)
 
So I am starting to create this program to read a text file and copy the text to another file until it reaches the line that is </settings>. I thought I was do...
[42 replies] Last: I can see why you would ask that. Originally the idea was to come up w... (by Vendetto)
by Mif
Help with ASCII "C"
 
Hello again.. I wrote a game and I use some of these symbols "220, 221, 222, 223, 219, 17, 2.... etc" in the code with the 'printf()' function like this: pr...
[5 replies] Last: Well.. Now you see what I meant jlb ? As you said in your second ... (by Mif)
Print Vector from Class
 
Hello, I am trying to read a data file into a vector and print the values through class. When compiled there are no errors, but the program just stops after ope...
[4 replies] Last: void readfile() { while(infile >> t) { f... (by seeplus)
Exception handeling
 
I want to demonstrate all exception in one program. I try to demonstrate in a single program. But i am confused is my code right for this question?(Write a C++ ...
[3 replies] Last: Thank you Andy (by drhunter)
ternary operator
 
I have problems understanding ternary operator. I read basics of how it works many times, and have basics understanding, but still strugle to fully follow throg...
[2 replies] Last: > Does this ternary operator code mean the same as the code below it? ... (by JLBorges)
update on vehicle registration
 
Hi all! So, the other day I posted asking for help on writing a program to meet the following criteria: Problem: Write an application in C++ that calculates th...
[4 replies] Last: Hello Handy Andy. I scrapped the whole code, and decided against using... (by kmcfall)
Function
 
Hello guys.I'm new at c++ programming.I have a question for you.The question is : Add a new function that find how many students have avscores>5 and calculate t...
[2 replies] Last: Guess this means that you have your answer? That was fun to work on. (by Handy Andy)
December 2020 Pages: 123456... 11
  Archived months: [nov2020] [jan2021]

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