Beginners - October 2016 (Page 16)

What's wrong with this code?
 
This is supposed to be a program which finds the most frequently typed in number #include <stdio.h> int main(void) { int stats , i, j; int mode, cou...
[5 replies] Last: > it does not output the result yes, it does. perhaps you didn't input... (by ne555)
Apply unique_ptr pointer instead of the usual
 
Hello. Please tell me, how do I replace the code of the design with the use of smart point using namespace std; int S=4; class HeavyCar { /*....*/ ...
[1 reply] : Think of what you're trying to achieve with your raw pointer to pointe... (by gunnerfunner)
by jo123
How to copy pointers of different data types
 
I am able to copy pointers of same data types as below: #include <iostream> #include <cstring> using namespace std; int main () { string *first = new strin...
[6 replies] Last: What can be done when we have multiple data members in the struct? W... (by keskiverto)
by pork95
help with linked lists and matrix
 
ok so i have matrix (random numbers) A = { {5, 18, 32, 87}, {11, 76, 32, 12}, {54, 47, 32, 90}, {12, 7, 32, 99} }; (M is 5, N is 4) I need to create...
[8 replies] Last: I just declared 2d array in main, because i've never used linked links... (by pork95)
Cannot get a string from user input stream in first loop of entry
 
Hello, I have written the following code below. The outcome I would like to achieve is to be able to get data from a user input stream about city informatio...
[3 replies] Last: The number of cities, which you are using to set the size of your arra... (by lastchance)
Nested Loops in C++
 
Hi! I have been working on creating different types of right triangles with nested loops. So far, I have succeeded with most of them except for the mirrored one...
[3 replies] Last: Looks like you need double the number of leading spaces. Try changing... (by student2019)
Game of Life Neighbour Checking Not Working
 
Hi guys, I've officially given up on this one! I've been pouring over this code for a few hours now and I can't figure out why it's not working properly. I wa...
[2 replies] Last: Thank you so much cire! I knew it was something simple I was overlooki... (by sunjinsak)
Question based on C - String. C++
 
Write a program that asks for the user‟s first, middle, and last names. The names should be stored in three different character arrays. The program should the...
[13 replies] Last: Edit : Added a line. Now the code is perfect. Not really. You have ... (by jlb)
by TeeWee
nested loops info help in c
 
i am trying to understand nested loops can someone explain to me how it works i don't under stand the concept this is the circle-drawing algorithm for each row...
[3 replies] Last: thank you.. i fix it.. by any chance do you know what for each row fro... (by TeeWee)
Cin ignore bad input completely
 
try { int code = 0; std::cout << "Please Enter 8 digit number: "; std::cin >> code; if (std::cin.bad()||std::cin.fail()) { std::cin.cl...
[2 replies] Last: You might have a look here: http://www.cplusplus.com/forum/beginner/10... (by cire)
Newbie
 
Write a C++ statement that uses the manipulator setfill to output a line containing 35 stars, as in the following line: I am very confused on this proble...
[2 replies] Last: http://www.cplusplus.com/reference/iomanip/setfill/ (by SamuelAdams)
2d array
 
How can I print 2D array each line biggest numbers to 1D array?
[15 replies] Last: @Arslanwhatever Really? Cause they sure do fit the description you ga... (by SakurasouBusters)
Recursion in a try catch?
 
If an exception is throw in a recursion, will the try in the recursion call catch it or will the try in the original function ran catch it? This is all assuming...
[3 replies] Last: If a throw occurs outside of a try block, it will be caught in a funct... (by cire)
Practical difference between REF and PTR
 
I am trying to understand the 'practical' difference between sending a container to a function as a reference and as a pointer. Two versions of the same progra...
[1 reply] : One difference is that you can't do setem(nullptr); if you're taking... (by cire)
Xcode and Files
 
I am confused about the inability for this code to work. All others that have used visual studio have gotten this to function, however I am trapped in an Xcode ...
[3 replies] Last: If the input file is called x.txt then reply to the prompt as x.txt I ... (by lastchance)
Problems with a while loop
 
So this code is suppose to print out the results of 0*1, 1*2, 2*3, 3*4, 4*5, 5*6, 6*7, 7*8, 8*9, and 9*10. It prints out the number 0 and thats it. Any help. Do...
[3 replies] Last: I knew it was gonna be something simply that I just wasn't seeing beca... (by needhelpplease)
separate string and numeric value from a string
 
hi forum, The following snippet of code is not doing the task properly. I have large string with the following format: std::string("13 DUP 4 POP 5 DUP...
[2 replies] Last: Hi , But what about the format "+ -", where you have no numeric value... (by sajis997)
by noxBox
[Help]Calculating the number of work days..
 
I've been trying to write a program(in c++) for the past couple of hours that is supposed to calculate the number of work days between two, user created, dates....
[10 replies] Last: Thanks, you've been very helpful. I'm marking the thread as "solved" n... (by noxBox)
Trying to open a .txt file for decoding
 
Hey very new to C++, so we have to decode this message for an assignment in class but when i try to open the original message it just says the name of the file...
[4 replies] Last: There are two separate problems. The first, there is a logic error in... (by Chervil)
what does colon in c++?
 
we see (:) everywhere, in class,switch ,goto and ... but my real question is what does colon in c++?
[1 reply] : It is part of syntax. Simialrly, we do have punctuation in human lang... (by keskiverto)
October 2016 Pages: 1... 1415161718... 51
  Archived months: [sep2016] [nov2016]

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