General C++ Programming - March 2015 (Page 9)

Magic Square Tester
 
Hello there the class i am taking requires this program however it is very confusing and i cannot pick up on how this all works. I have been trying to make a ma...
[2 replies] Last: Thank you so much that is what i needed!!! (by iczebra)
Vectors, Classes and functions
 
I have 2 questions 1. how do i access a class's function if said class is part of an std::vector. example: class Obstacle { void function(); }; std::vect...
[3 replies] Last: Use uniform or copy initialization to give default values to class mem... (by MiiNiPaa)
HELP! While loop?
 
Hello everybody, this is my first post of probably many to come. I'm currently taking a basic C++ course and am stuck on one of my assignments, and was seeking...
[2 replies] Last: The cin.get() is not necessary but the code MUST incorporate a while l... (by Leonhart)
mingw32 and SDL2
 
Im having troubles with having my makefile compile my project. Normal make just builds the libary and everything is correct. But when i do make app it tells...
[8 replies] Last: Problems like this are annoying... (by Gamer2015)
by yj1214
How do I create dll and lib files with g++?
 
I have few questions about dll and lib. First questions is, what are they anyway? Second questions is, how do I make these two files with g++? My las...
[1 reply] : Read this: http://en.wikipedia.org/wiki/Dynamic-link_library http://w... (by coder777)
What does void mean?
 
Hi Everyone! I sort of understand how to write functions however, I'm having trouble understanding void. For my assignment I have to do use a previous assign...
[2 replies] Last: void in first function, it means it has no parameter. void in last f... (by xenovia12)
Recursion
 
Having trouble understanding when the function recursivePrintStars calls itself again but this time with a slightly different parameter. void recursivePri...
[1 reply] : The easy way to understand this is to use it. Just write: int main()... (by ats15)
Practice using file I/O
 
Write a C++ code to –Read two test scores from input_file.txt –compute the average of the scores and –write the output to output_file.txt. –Display ...
[1 reply] : Please use code tags (the button with <> on the left). It will make th... (by ats15)
Help I'm new to C++ and I can't figure this out
 
I have an assignment due and was never taught this, I read through the textbook at least 6 times and I can't find anything on it. Can anyone help explain to me ...
[1 reply] : You need to write the content of the getCylinderVolume function. I am ... (by ats15)
Complicated Project, procedural generation
 
I am trying to make a random generator for building interiors, but, not the standard rogue-like stuff. I am wanting something sensical, and that fills in the de...
[8 replies] Last: Okay, assuming I understand start and end states correctly, The pure ... (by DarkLightHitomi)
Templates Not working
 
For some reason it keeps saying missing ; before template< BTW INLINE is __forceinline. I already tried removing it and it didnt help #include "Resolver.h" ...
[3 replies] Last: #ifndef __DATATYPES__ #define __DATATYPES__ #include <Windows.h> /... (by cmajor28)
Pass by value Example
 
I compiled an ran this example but I can't seem to understand why it prints out a 3 and not a 2 if it should be decremented... #include<iostream> using n...
[3 replies] Last: Ahh I get it. Thanks! (by hazelkiss89)
Dynamically Allocating Array Space
 
I've been trying to understand how to dynamically allocate array space in my free time and I've started to work on a simple program that will store temperatures...
[no replies]
Please help I'm confused on what to do
 
Write your question here. Write a program that will perform integer addition in any radix from 2 to 20. Use the standard Hindu-Arabic numerals 0–9 and, i...
[6 replies] Last: Sure. You have the code to input the base. Now write a function that a... (by dhayden)
by yj1214
A question about variable assignment...
 
In my program, if I assign my variable in same line, my program doesn't work. int foo = myFunction(); whereas if I assign my variable in second line...
[5 replies] Last: this code is from Bucky's tutorial No, it is not. Your copy is not a... (by keskiverto)
by bawer1
(Calculating Statistics -Reading from a Text File) need help!
 
Ok, I have worked on this for approximately 5 hours, and I have not received the output I wanted, not even close. The program is pretty simple, its not long at ...
[no replies]
Generally speaking, how would you pass a dynamic array in C++?
 
Hello guys. I'm new to both C++ and the forum. I was just wondering how to pass dynamic arrays. For example, if a user inputs or creates the size of a dynamic a...
[2 replies] Last: template <typename T> T* passArray(T* array) { ... return arr... (by Smac89)
by Gyiove
delete, delete [] and delete [x] - what does x mean?
 
Hello everyone! Here's the code: char *c = new char ; int a; for( a = 0; a < 100; a++ ) c = 64; delete c; cout << (int)c << endl; what this...
[2 replies] Last: It is not valid C++ code. It is a Microsoft extension, and I am not su... (by LB)
Can someone explain why this recursive call works?
 
The program prints the permutations of a string. I was wondering why it works just the part where you swap the first two letters and why this works in a broad c...
[3 replies] Last: When I say it doesn't work, I am not trying to imply that the function... (by Smac89)
CircleClass Function
 
I am confused about how to continue with this function. I'm not asking for the code just a bit of direction as to how I should continue. #include<iostre...
[2 replies] Last: Sorry, I wanted to delete the other post but I don't know how or if I ... (by bug2207)
March 2015 Pages: 1... 7891011... 28
  Archived months: [feb2015] [apr2015]

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