
please wait
Inserting element at the end of a linked list. |
Well,The function InsertAtTheEnd(); is not working as expected. My logic is sound and implementation also pretty accurate,I know i must've done some silly mis... |
Jul 24, 2018 at 5:48pm
[3 replies] Last: Remember to check that temp5 is not null before entering the loop! (by helios)
|
How to code grid perimeters |
Hi, I'm new to c++. How can I create a simple grid map using a 2D array, in C++? Like below illustration as an EXAMPLE: # # # # # # 5 # 1 # ... |
Jul 24, 2018 at 5:33pm
[2 replies] Last: #include <iostream> #include <string> #include <vector> #include <ran... (by icy1)
|
Inserting element at nth position in Linked List |
The function InsertAtnthPosition() is not executing properly at the program crashes. I have yet to add deallocation statements. What is the error in that functi... |
Jul 24, 2018 at 4:44pm
[7 replies] Last: Actually I've been always indexing linked lists from 1 since i started... (by akshatmahajan3112)
|
by Willogical
follow up: console closing down, code example (1,2)
|
I wanted to follow up about the console closing, and one of the solutions. Is there any way I could get some help debugging my code, and turning... |
Jul 24, 2018 at 4:42pm
[28 replies] Last: This looks like crap because it is looping through so fast. But press ... (by Manga)
|
by jamesfarrow
bit operations
|
Hi - can anyone explain to me why these are not equivical? Or at least they are not on my iMac... Thanks in advance James #include <iostream> #include <bit... |
Jul 24, 2018 at 4:26pm
[3 replies] Last: Strange example, since 16387 << 2 comes out to 65548, and typical rang... (by icy1)
|
by JeffR1992
Checking if a key exists in an unordered_map and incrementing its value
|
I'm trying to check if an unordered_map contains a particular key, and if this is true, then increment the key's associated value by 1. However, I seem to be ha... |
Jul 24, 2018 at 4:12pm
[6 replies] Last: too few mentions of '43' in the output from other answers, or actually... (by icy1)
|
by BGA6444
Arrays with incrementing values...yay! :(
|
So the code is supposed to be basically like a survey. And it would be soooo easy if we could write our own code how we wanted... but our teacher wants it his w... |
Jul 24, 2018 at 3:34pm
[5 replies] Last: @BGA6444 -- when did the teacher code stop and yours begin? It's not ... (by icy1)
|
by t009
Ctrl+Z causing double entry in while(cin)
|
Using ctrl+z to exit a while loop causes the loop to record the last value twice into my vector. Any idea why? while(cin) { cin>>input vector.pushback(input)... |
Jul 24, 2018 at 2:06pm
[2 replies] Last: One quirk of C++ is that a stream doesn't register end-of-file until a... (by dhayden)
|
by PhysicsIsFun
int / float
|
Greetings, short question: a = static_cast<float>(150-i*i)/10.0f a is a float, i is an int. Why is static_cast necessary? I divide integers b... |
Jul 24, 2018 at 11:39am
[2 replies] Last: Thank you jlb, I am not using anything, it's from a book :) (by PhysicsIsFun)
|
by Hollowman
Trying to understand how to access objects members from functions
|
Hi all, my first post here! So, I'm pretty new to c++ and still getting to grips with some of the basics. I've been trying to read as much stuff before askin... |
Jul 23, 2018 at 10:10pm
[2 replies] Last: Ah ha! I can't believe it was that simple! Thanks very much :) (by Hollowman)
|
by passiontrip
Destructors
|
I'm having a hard time understanding the application of destructors to a class. My book only gives one example and it's not the best and the examples online I ... |
Jul 23, 2018 at 8:26pm
[3 replies] Last: Ahhhh ok thank you both for the responses that definitely clears it up... (by passiontrip)
|
Unable to access options |
Hi, I'm new to c++ and really need your help to program as stated by topic. I can't seem to get my main menu switch case to work. Whenever I select '1', its ... |
Jul 23, 2018 at 6:22pm
[2 replies] Last: You had the correct idea for a menu, you were simply missing a few ite... (by closed account E0p9LyTq)
|
by sgill1998
Segment Fault.
|
So i`m trying to finish up a program i`ve been working on but I have hit a wall with a segment fault. It runs perfectly for a little bit but than as you go alon... |
Jul 23, 2018 at 1:50pm
[4 replies] Last: I have hit a wall with a segment fault Lucky you! I can’t even com... (by Enoizat)
|
by Willogical
looking to learn from breaking the rules
|
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."-Bjarne Stroustrup. What does "blowing w... |
Jul 23, 2018 at 1:33pm
[2 replies] Last: > I want to know besides things like infinite loops, any "ill advised"... (by JLBorges)
|
by bcoleman
Changing to arrays
|
// I need to change this to arrays but can not figure it out #include <iostream> using namespace std; // Function Prototypes void getJudgeDa... |
Jul 23, 2018 at 1:20pm
[6 replies] Last: #include <iostream> #include <algorithm> #include <iterator> constex... (by JLBorges)
|
by RytisBe
while(1) & Interrupts
|
Hello everyone, I am using PIC micro controller to program a series of leds. My question: is it possible to break out of while(1) loop in the animation with an... |
Jul 23, 2018 at 12:40pm
[4 replies] Last: I need to clear g_status bit, but not sure how to do it. g_status... (by Repeater)
|
by b3y0nd
2D - Array - User input - Nested For Loops
|
I am calling a function getsales - asking for the elements to fulfill a 2D array using FOR loops. I was getting errors compiling for quarter and column count... |
Jul 23, 2018 at 12:36pm
[9 replies] Last: Hello b3y0nd, For this subject you are welcome. I am glad it worked o... (by Handy Andy)
|
by amiable143
problem passing 2-D vector to a function (1,2)
|
why am i getting runtime error ,i spent a lot of time learning taking user input in 2-d vector ,still i am failing to do that. Somebody,please help #include<b... |
Jul 23, 2018 at 10:47am
[24 replies] Last: thanks a lot ...can you help me with debugging on code blocks...i ca... (by MikeyBoy)
|
by b3y0nd
Saving / opening / saving arrays
|
Is this the best way to go about saving / opening / saving an array. had the first program because the file pathway to storing a file was a problem, seems so... |
Jul 23, 2018 at 8:56am
[2 replies] Last: You could also write on a binary file. I think it would be less tediou... (by H00G0)
|
by Donut
Bubble Sort
|
I am attempting to sort some salary data that I import using bubble sort. However, I am not getting the sorted data out to the screen. What am I missing? ... |
Jul 22, 2018 at 11:26pm
[9 replies] Last: Thanks again for your help and guidance. As I stated previously I am m... (by Donut)
|