Beginners - May 2016 (Page 19)

Getting digits out of an int?
 
I'm having trouble with getting the digits out of an integer. Here is my assignment instructions. Define a class named MyInteger that stores an integer. It has...
[3 replies] Last: #include <string> class MyInteger { private: int x ; public... (by JLBorges)
by Nick89
Mystery for loop
 
Hi all, I found this piece of code in my notes and I have no idea why its there or what it does. I was hoping someone can shed some light on it for me. ...
[2 replies] Last: You would assume correctly. Thanks (by Nick89)
Functions
 
....
[8 replies] Last: > So this question does not have to necessarily be done with functions... (by JLBorges)
by Dkob1
Pointers?
 
I'm somewhat new to pointers, when I ran this program, I got an output where I'm confused. How do you get those long addresses for some of those? How would you ...
[8 replies] Last: Ok thanks for the help, appreciate it! (by Dkob1)
by brad97
Dynamically allocating private member variables?
 
I need to create a class in which all member variables are dynamically allocated. How do I go about dynamically allocating member variables string name, double ...
[3 replies] Last: You declare dynamic member variables like any othe dynamic variables. ... (by Thomas1965)
by Bligen
Straight forward program vs void functions
 
Is it better to write a code (approx 200lines) in one go or in like 4-5 void functions? Why? In what situation would it be the opposite?
[3 replies] Last: Hi, Consider that you are writing a book: would you write the whole t... (by TheIdeasMan)
Function help with Program Perimeter
 
Hello, I am currently trying to make a program without changing this program in which I will put. I can only add functions and comments to the code. My confusio...
[6 replies] Last: Please reload the page I edited my comment. (by ephraimr)
Help! Empty output when I compile a simple code
 
Hello. I am a beginner of c++. I am having problems running a simple "hello world" that codelite IDE generate automatically when you create a new proyect. W...
[1 reply] : Make sure you are selecting a Console Application project -- because... (by Duthomhas)
Help?
 
How can I input a number for example 54503 and let the program go through all the numbers and check if there is an even number or not? I think it should be insi...
[3 replies] Last: Yes, use this loop. int n; int m = n; while(n > 0){ if( (n%10)%2 == 0... (by ephraimr)
How do I open and write to a file w/out deleting previous contents?
 
I am staring to learn c++ as a hobby, and my current "project" is to document the workload of my weightlifting sessions. As of now my code (when executed) will...
[10 replies] Last: Yes, I can see how it's better (especially for me) to write to a file ... (by kerryleon)
Converting 2d Array into Vector
 
I am trying to convert a 2d array into a vector. In the code below, the function "flatten" is supposed to take a 2 x 2 array and "flatten" it into a one-dimensi...
[2 replies] Last: Thank you! The following is a code that flattens a 100 x 200 2d array ... (by Pegasus1)
Structures Confusion
 
Hey guys, I am new to the forum. I'm taking classes for C++ at school. I am having trouble getting the total and the average for my program. I don't know exact...
[4 replies] Last: Yeah, I caught onto that after a minute or two. Thanks for your help t... (by closed account 3voN6Up4)
by brad97
Help Outputting Dynamic Array
 
I am trying to write a program in which the user enters the size of a dynamic array, then enters in the contents of the array, outputs the array through a separ...
[1 reply] : You have several problems with your code: 1. you are not allocating e... (by closed account E0p9LyTq)
Returning Time as strings--Help
 
I want to return Hours:Minute:Seconds as a string for GUI reasons. How can I do it using the following: void digital_display() { typedef duration<int, ...
[1 reply] : This: http://www.cplusplus.com/reference/ctime/strftime/?kw=strftime (by coder777)
Pushing Back A Vector Into a Vector
 
I am writing a program that should append a vector w to a vector v. But I get a compilation error at "v.push_back(w);". I would appreciate the feedback. Thank y...
[3 replies] Last: I think I got it. Here is my code without using the standard vector in... (by Pegasus1)
Code is not computing correctly.
 
You are to write a program that will manipulate an array. Your program should handle up to 50 integer numbers. You have to count how many values you read in and...
[2 replies] Last: You've just encountered an example of how fragile and error-prone it i... (by Chervil)
Linked list while loop not terminating at NULL
 
I have a linked list with three Persons: "Tom", "Dick", and "Harry". Each Person is stored in a PersonNode with a pointer to another PersonNode. As you can s...
[9 replies] Last: I will try to solve it today. If it won't work I will give it to my fr... (by AlexanderThomas1983)
Assistance in Object Oriented Bulls&Cows game.
 
Hey guys I have been stuck at a point in this program where I cant figure what to do next. The homework I was given gave some codes for use to follow on but s...
[5 replies] Last: You also never call srand() to initialize the random number generator ... (by AbstractionAnon)
May 2016 Pages: 1... 1718192021... 36
  Archived months: [apr2016] [jun2016]

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