Beginners - January 2017 (Page 9)

by Houd
Generate Code Depending on User Input (1,2)
 
Is there a way to generate code depending of user input? For example, if I have this code: switch (a) { case 1: a(); break; case 2: b(); break; c...
[20 replies] Last: Awesome. It's the "running it millions if not billions of times" that ... (by dhayden)
another pointer question
 
Hi guys I'm getting the hang of pointers thanks to all the great people on this forum =) but I have one question here is my sample code #include <iostream> ...
[3 replies] Last: anyway what is the difference between passing a pointer into a functi... (by MikeyBoy)
New to using files
 
I have made a program that takes in a sentence from the user. Then the program makes a list of words that has one copy of each word from the sentence with no wo...
[9 replies] Last: Ok thanks anyway (by boringblobking)
pointers question
 
Hi I am in the process of figuring out linked lists but one thing that is catching me out and I know it's probably fairly basic by how come when I try to create...
[7 replies] Last: Thanks guy I understand it now,seems so complicated yet in reality it'... (by adam2016)
Arrays and Structs - BUG! - C++ (1,2)
 
Guys, my code has a bug, don't know where it is and how to fix it ? Any help? #include <iostream> using namespace std; struct x { int* array; int s...
[20 replies] Last: Yeah, my prof last term was really strict with naming and all the corr... (by Kourosh23)
Arrays and Pointers - Reference Only!
 
Original Question from: Kourosh23 Answered by: Chervil @Kourosh23 Also, I don't understand why it is an error ? I am simply passing value to the pointer whic...
[no replies]
Signal Alignment Code
 
Hi, I'm fairly new to programming but for my final year uni project I'm needing to develop a DSP that automatically time aligns a DI signal and a microphone sig...
[2 replies] Last: Essentially I'll be using a software called clio that will read the tw... (by EdJames94)
Simple member function involving coins
 
I am trying to write a member function for a class I have. The class is called Coins, and acts as a coin purse that keeps track of how many quarters, nickes, di...
[3 replies] Last: In all seriousness Coins should be renamed Purse and without vectors t... (by closed account 48T7M4Gy)
Just starting to learn C++ using the tutorials
 
Just starting to learn C++ and have encountered a problem. When I try to run the code in this: http://www.cplusplus.com/doc/tutorial/program_structure/ I just g...
[1 reply] : Sounds like the settings on your compiler or IDE are incorrect. Goog... (by EtDecius)
Linked list with pointers
 
Hello people I'm reading Alex Allains c++ book and I just got done with pointers to pointers which I had no problems with then we move onto linked lists but t...
[1 reply] : A pointer to a pointer is rarly used. There are usually two scenarios:... (by coder777)
Need help with a program!
 
Hey guys, I wrote a program that finds the seat selection available for a movie theater and all that good stuff. I'm practically done but when the user inputs 0...
[1 reply] : I've tried several things but couldn't get it to work. It might mak... (by closed account 48T7M4Gy)
Random Number Generator Question
 
Hello, for my assignment we need to create a code that generates 1. n number of random numbers (from 0-100) and store them in an array 2. then we have to as...
[5 replies] Last: @gunnerfunner what's with all the C header files I used them too, si... (by closed account 48T7M4Gy)
Dynamic cast
 
Please excuse this Long example, but I am not sure, which parts are relevant. My question is: Is the dynamic type cast in the following example correct? cla...
[6 replies] Last: from above: tries to convert the pointer returned by it->Next() to a ... (by gunnerfunner)
Writing to two dimensional vector within structure
 
I want to write to a two dimensional vector that is part of a structure, it is of type boolean, and also, I am using SFML in my project and would like to know h...
[5 replies] Last: So, I kept trying and still couldn't find an answer. (by Optimistic Peach)
Judges scores
 
This is a homework problem, but the only problem I am having trouble with is taking 5 scores, getting rid of the highest and lowest, then averaging out the ...
[1 reply] : int largest = 1 , smallest = 0 ; if( a > largest ) { largest... (by ar2007)
Files - Skipping lines
 
Hello! I'm attempting to read the first letter of every line, and I'm not overly sure as to how I'd get to that point. I've been able to read the first letter o...
[3 replies] Last: Is there any chance you could explain how you got the program to read... (by cire)
by moop
how would this be done?
 
Hello, I am new to C++, basically I am trying to make a program that while you are holding spacebar a number decrements, once your health is equal to 0 I want t...
[2 replies] Last: Hello moop, This is not as fancy as what whitenite1 did, but it is bu... (by Handy Andy)
pointers and multi dimensional arrays
 
Hi guys I'm trying to grasp the concept of how pointers work with multi dimensional arrays but I'm finding it hard, I know this code will get the value of wh...
[2 replies] Last: thanks gunnerfunner =) (by adam2016)
Area and volume of a parallelepiped
 
Hello.I need a class program which contains: destructor, constructor,member functions for area and volume of a parallelepiped.
[1 reply] : Sure, and ? (by gunnerfunner)
First Letter of Every Line in File
 
Hello! I'm trying to figure out how to create a program that prints the first letter of every line in a file, but I'm at a bit of a loss as to how to only take ...
[5 replies] Last: Yeah, you're right. A more robust approach would be: #include <iostr... (by gunnerfunner)
January 2017 Pages: 1... 7891011... 24
  Archived months: [dec2016] [feb2017]

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