Beginners - January 2020

Brain Fart.....
 
I think im having a brain fart bc i can't figure out how to do what im doing. I have a huge multilayered class that im building and i've never extensively work...
[13 replies] Last: Another thought: If one implements the rotate cube function, there wo... (by TheIdeasMan)
Container class with 1D array
 
Hey guys, we are supposed to be doing this program using a container class to store (x, y) values in and I already wrote this program using a 2D array, but did ...
[1 reply] : there are a number of ways to do this. you can roll your own: struct ... (by jonnin)
Can someone explain this code?
 
Here is some code I ran across: #include <utility> template<typename T1, typename T2, typename RT = std::decay_t<decltype(true ? std::declval<T1>()...
[9 replies] Last: [quote=TheToaster]This is from a textbook Everything is explained in ... (by Enoizat)
by Hex213
std::map destruction value
 
Hallo, can map destruct pointer or class when it is value? Or I need to define a destructor separately? Example: Class token{}; map<blah, vector*> map<...
[1 reply] : Destruction of a plain pointer does not deallocate the memory that the... (by keskiverto)
Segmentation fault (core dumped)
 
Hi, I am trying to work with pictures on C++, and I would like to obtain the size in bytes of a given picture. However, the following message shows: "Segm...
[5 replies] Last: yes, c++ compilers support C and c/c++ mixed. Yes, you can fix it.... (by jonnin)
looking for string
 
Hi, I would like to use this function to looking for some element from array of strings (JmenoSerialu). This is what code blocks is writing error: a function-d...
[3 replies] Last: you can return without a value, eg return; but the error message to ... (by jonnin)
C++ Stack Implementation (Occasional Seg Fault)
 
I'm trying to figure out a problem with my program. It works 75% of the time, and when pushing an item to a new stack ADT it will occasionally seg fault. Thi...
[19 replies] Last: Sarcasm and passive aggressive reaction in large doses. Ah, the wonder... (by againtry)
Can anyone please tell me what this error means?
 
Write your question here. I met tons of error , anyone help me? #include <iostream> using namespace std; int main() { int n; cin>>n; int tran...
[5 replies] Last: Don't forget that you can't make an array like that, in your line 5 I... (by againtry)
Not compiling, problem with Serial.print()
 
This assignment (due yesterday) has some pretty specific instructions like declare alphaDeg as float and use Serial.print() to print to the serial monitor. We a...
[5 replies] Last: green tick please so we can see problem solved :) (by againtry)
Adding two floating point numbers using IEEE 754 standard
 
Hi everyone, I'm a beginner so some of the part of my code might seems stupid and redundant, please just ignore them for now. I'm doing an assignment where ...
[no replies]
Most ridiculous bool condition ever?(member array indexing)
 
Hi all This program is just me experimenting/trying stuff for the sole purpose of learning. I fully intend to move to SFML later when I'm actually able to writ...
[3 replies] Last: The route mapping in this case wa random but a structure way through a... (by againtry)
A simple snake game
 
Hi, i am making a simple snake game but i cant seem to be getting it right. firstly, i want the game to terminate when it hits the wall, second once the snake h...
[2 replies] Last: Line 4. Avoid using namespace std; . It brings all of the standard li... (by dhayden)
Why Doesn't This Lead to C++'s Most Vexing Parse?
 
#include <iostream> using std::cout; class abc { public: int i; abc(int i) : i(i) {} }; int main() { abc a(10); // A is initiali...
[3 replies] Last: Yes. And 'a' can be made a variable with parentheses: abc (a(abc()));... (by dutch)
Text adventure game, how to make loop
 
If the user inputs something other than 'a' or 'A'. Then it will simply ignore it and wont output the cout statement. How do i make it so that if the user doesn...
[1 reply] : Lol this is untested but I been working on using these kinds of expres... (by markyrocks)
Determining array size based on file input
 
Hi all! I need to write a function that receives an input file and an array, reads the data in the input file, and returns the size of the array, based on how m...
[5 replies] Last: Got it. Thanks! (by SamIAm3)
getline and reading into a struct array
 
Hello, I'm stuck at the beginning of this project and can't figure out what I'm doing wrong. I've read at least a dozen other posts asking similar question...
[1 reply] : The getline that you are using expects a std::string, not a raw char a... (by dutch)
by xoox
Manual Reverse string [CHALLENGE]
 
I was challenged to create a function that will reverse a given string, and unfortunately running out of time. this is my last resort I was restricted to u...
[4 replies] Last: #include <utility> #include <iostream> char* reverse_string(char* s,... (by mbozzi)
Meaning of "free(): *some error*"
 
I keep running into runtime errors that start with "free(): *some text*. I would like some help in understanding what these errors mean. For example, I ...
[4 replies] Last: > "free(): *some text* there are some cases where it pays off to read ... (by ne555)
Moving array of characters
 
Hi }
[3 replies] Last: move the player before printing the map (by ne555)
by bhoot
Singleton value not increasing
 
Hi, I was testing something with singletons where I came across a behavior I'm not understanding. I created a singleton class A. The object had an integer o...
[2 replies] Last: Yep, that got it working. Thanks for the answer. (by bhoot)
January 2020 Pages: 123... 12
  Archived months: [dec2019] [feb2020]

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