General C++ Programming - October 2014 (Page 22)

by homing
Pointers,References,Smart Pointers
 
Hey, I'm a Game Developer and saw a lot of Game Engine Code and Company Code(C++) and I'm still not sure about References, Pointers and Smart Pointers. I have...
[5 replies] Last: Well when I use pointers i just use them like -> string name* = &othe... (by mutexe)
by zoso
using variable in the "pow" function
 
I'm trying to figure out what is wrong with this: static_cast<int>((pow(x, counter+1)) % 10) it says "more than one instance of overloaded function "pow" ...
[5 replies] Last: k (by closed account 1CfG1hU5)
Aliasing member variable names
 
I have been playing about with Vertices and Colors and have ended up with this: template < std::size_t SIZE, typename T > struct Pack { T data[ SIZE ]; }; ...
[3 replies] Last: C++ does not have such facility. So you have to emulate it. Honestly, ... (by MiiNiPaa)
by Ispil
Bizarre SegFault
 
Well, this one has me stumped- I have code that... well, works. Other than some segfault. Using Code::Blocks, I managed to determine that the segfault happens w...
[7 replies] Last: Yeah, I realized that for what I'm doing, there are already much bette... (by Ispil)
Quick question on continue (1,2)
 
4. Describe how "break" and "continue" statements work with looping constructs. Consider the following code fragment: int i=0; ...
[21 replies] Last: spare me the technical bs. You're on a forum where it pays to be te... (by cire)
can "endl" be changed to end line twice? (1,2)
 
cout << "this is a sample text " << endl << endl; int t; t = endl+endl; ? looking for a single endl define to end line twice.
[27 replies] Last: whatever a #define is called, someone posted don't use a ";" with #def... (by closed account 1CfG1hU5)
by YEUNG
how to make this , i have no idea about nested loop
 
when i enter an integer 5 , two pattern just like the following would print pattern 1 Pyramid A: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 1...
[2 replies] Last: Modular arithmetic to the rescue, make use of the % function. (by closed account 48T7M4Gy)
Hey guys need some help!
 
Hey guys I'm in terrible need of some basic help, I was given this assignment and i can't quite figure it out, most of you will find this extremely basic howeve...
[2 replies] Last: THANK YOU !!!! <3 (by Drew214)
Help me move pieces in a checkers game.
 
I need to make the game checkers in a 5x5 board. I have created the board and put the pieces in the places I want but im stuck writing the movement part. You ca...
[no replies]
by santix
function argument
 
Hello... I want to declare a function that prints any nxn matrix But the compiler won't let me declare a function for a variable dimension. How can I decla...
[2 replies] Last: I use C++ in Code::Blocks. Ok, I'll try to slowly understand the ans... (by santix)
new function for getch()?
 
is there a new function in c++ for getch(), getche() which is in C and some C++ dos compilers? i noticed cpp.sh does not have the conio.h library. please...
[no replies]
how to read struct from binary file??
 
hi i have this file want to read it source code help plz https://www.mediafire.com/?7a9649gz29efa94
[10 replies] Last: This is Complete file and really i want decompress it. https://www.me... (by sultan1985)
Deleting Vector of Pointers
 
Hi everyone I made a vector of pointers and the problem is that I have trouble deleting the pointers in the vector. I used to simply do vector.clear() or vecto...
[5 replies] Last: The advice on std::shared_ptr and std::unique_ptr are really usefu... (by Dark Goomba)
by toast9
passing pointer into template function
 
I'm trying to pass the pointer of a dynamic array into a template function, but it keeps telling me there is no matching function to call because the parameters...
[4 replies] Last: Try using T* list , as you are passing pointers to arrays. Or is that... (by Zhuge)
Exception handling class syntax
 
Hello. I am confused with the code : include <iostream> using namespace std; class dividebyzero { public: dividebyzero(); vo...
[7 replies] Last: I think the title of the topic was a mistake. (by LB)
need help
 
the program i have is running it has the calculations right. but im trying to get the program to display all the numbers of cars entered, total for all cars and...
[5 replies] Last: #include <iostream> #include <math.h> #include <string> using name... (by closed account 1CfG1hU5)
Help me with this please is for tomorrrow
 
When you play a board or card game or when you use a shared computing resource, you get a turn and then wait until everyone else has had a turn. Although the n...
[9 replies] Last: this are the classes to use in this program (by cofresi91)
c++ help
 
Syntax: string nameAlter(string name) { string Lname; string Rname; string x; string len; int CommaLocation; CommaLocation = name.find('...
[1 reply] : This should do it: std::string standard_format = name.substr(name.f... (by ResidentBiscuit)
by Jweim
If/Else statement; Expected Expression Error
 
I'm trying to compile this simple program in Xcode, however, it keeps giving me an error saying expected expression. I thought I had my brackets in the correct ...
[5 replies] Last: @tipaye, that worked perfectly! thank you! (by Jweim)
for those who used C4Droid app on their Android phone?
 
is there a way to combine header file (made for a created class), actual class and the main function on the same page? I'm trying to learn c++ code using my...
[1 reply] : For small programs, like learning exercises, it is permissible to incl... (by doug4)
October 2014 Pages: 1... 2021222324... 38
  Archived months: [sep2014] [nov2014]

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