General C++ Programming - May 2013 (Page 14)

by Cagdas
Stuck with the std:copy() function
 
hi all, could you describe how can i copy the elements with std::copy() function here is the code, i am stuck with it, thanks in advance. static int c...
[5 replies] Last: it's so ridiculous, but i hâve to find it. the the copy function in l... (by Cagdas)
by Snaksa
Sudoku Solving algorithm
 
Hi guys! I'm trying to make a Sudoku Solving program for a couple of days but I'm stuck with the steps. I google an algorithm which can help me. I found this al...
[2 replies] Last: One thing to remember is that valid indices for arrays are 0 to size-1... (by cire)
by tgckpg
How do I declare array of array but with different size? (1,2)
 
I am a beginner. I searched for hours an got confused about how declaring this: { {1, 2}, {1, 2, 3} } Both outer and inner array had known size. How do I ac...
[20 replies] Last: Probably -- but I couldn't give you a clear answer without putting in ... (by andywestken)
C++ String programming
 
Hello, I have come across this problem floating around the wonderful, amazing, and fantabulous internet just waiting for it to be solved. But I cant so can you ...
[1 reply] : It looks like the algorithm just wants you to peel the next character(... (by Duthomhas)
by h0404
Difficulties to use boost
 
Hello, I am learning C++ at home with Visual Studio 2012, and need to do an assignment using boost libraries. I have downloaded the latest version, but do n...
[3 replies] Last: You could use CMake - it will help create MSVC project simply with sup... (by Ivan Sidarau)
Command Line Parameters
 
Hi there, I googled for command line parameters in C++ and founnd out that I could use argc and argv. The problem is the type of argv. I need to read commandl...
[8 replies] Last: Wait, now I'm confused. First you convert to std::string , now you ar... (by Duthomhas)
by cCj
condition op. overload for class
 
hi can you overload class operators so that you can do this? if(Smartpointer) {} and this: if(Smartpointer == x) {} proplem i'm running to is tha...
[5 replies] Last: that did the job! :) thanks (by cCj)
Why does this code run?
 
#include<cstdio> int main() {puts("abcde");} I haven't put std:: before puts and main doesn't return. The code was compiled and linked using 'Micr...
[8 replies] Last: MSVC++ 2008 gives compile error with this code: #include<iostream> ... (by eklavya sharma 2)
Use a class function in another function
 
Hello, I have a problem in using the nlopt optimization library. I have defined a class: class GARCH { private: //variables... vector<do...
[no replies]
Smart Pointers in Vector
 
In this code: Person.h: // Person.h // A class defining people by their names #pragma once #include <cstring> #include <iostream> using std::cout; ...
[5 replies] Last: He also stated to always use std::string in any production program. (by Anmol444)
by Kronus
Adding values from an array
 
How would one add each value from an array? I'm working from a string but I was wondering if there was a way to loop through the string and add each value. This...
[3 replies] Last: #include <numeric> int sum = std::accumulate( numbers.begin(), numbe... (by vlad from moscow)
Add value to beginning (left hand side) of string (1,2)
 
This is probably a stupid question, but how do you add a value to the beginning of a string instead of the end? This is for an assignment and I have to conv...
[20 replies] Last: If it's a new problem, it should be a new forum thread. (by andywestken)
Pointers problem
 
Hi everyone! I am a little confused while comparing char pointers to integer pointers. Here is the problem: consider the following statement; char *ptr =...
[3 replies] Last: @kbw : ptr is pointer and cArr is pointer to the first element of the ... (by hamzaali906)
Pointers Concept Clarification
 
Hi everyone! I am a little confused while comparing char pointers to integer pointers. Here is the problem: consider the following statement; char *ptr =...
[2 replies] Last: The first statement you posted is incorrect. You must have a const cha... (by firedraco)
Text based v.g. save issue?
 
I would like to create a video game. It would be text based. How could I set up a save system? Also, how would I load it?
[3 replies] Last: ...video game... ...text based... Wha? (by cire)
Undefined Reference when I include GL\glut.h
 
I have a h file with the following in it: #ifndef RESOURCEMANAGER_H #define RESOURCEMANAGER_H #include "TextureMap.h" //#include <GL\glut.h> #include <vecto...
[1 reply] : So, I found out if I include both windows.h AND glut.h, it compiles fi... (by officialhopsof)
Changing variables in other classes Code::Blocks
 
I want to make a basic RPG text based games with multiple classes. but I wan to know how In one class I make a variable and in another and can call the variable...
[1 reply] : http://www.cplusplus.com/doc/tutorial/classes/ (by Zaita)
by Tresky
Copy Constructor and Assignment Operator
 
Hey guys. I've been working on some project and I got to wondering when you know you need to use a copy constructor and an assignment operator. Is there a ru...
[4 replies] Last: > when you know you need to use a copy constructor and an assignment o... (by ne555)
Formatting Output
 
How do I print this on the screen using #include<iomanip>: ************************************************* *********************************************...
[1 reply] : And what is the problem? (by vlad from moscow)
pre-increment vs post-increment
 
it makes sense that at least with larger data structures or classes that overload these operators, calling op++ returns by value and ++op returns by reference, ...
[1 reply] : [quote=caibbor]" However, references returned also have to be put into... (by closed account zb0S216C)
May 2013 Pages: 1... 1213141516... 47
  Archived months: [apr2013] [jun2013]

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