General C++ Programming - June 2013 (Page 17)

Get the size of a dynamic array
 
Dear programmers, I remember in C++, when a dynamic array is allocated, the size of this array is stored right before the array in memory. Therefore compiler k...
[2 replies] Last: That is what I'm worried, Thanks! (by mimichacha)
simple question about objects ,pointers and memory allocation
 
i've recently asked the same question and didn't get a good answer so ill be asking it again with some edits why they always use class_name *pointer = new cla...
[2 replies] Last: Sorry to correct in part the reply of coder777... I know I am not a pr... (by Nobun)
HOW DLL, HEADER AND LIBRARY
 
Hi, guys. can anyone help me about on how can i implement in my console application and use the DLL function. I have the header file name sgs_api.h with the ...
[2 replies] Last: Hi thank you for your reply. after that i follow this info, i get anot... (by credem12)
Problem with question !!!!!!!!!!
 
The question is: Write a program to a string from the user. Also ask the user to enter a character. Then find the position of first occurrence of that charac...
[3 replies] Last: How to use code tags: http://www.cplusplus.com/articles/jEywvCM9/ Wha... (by coder777)
by Daleth
Natural Logarithm
 
More of a question out of curiosity. Why are the standard functions for natural log and log base 10 "log()" and "log10()," respectively? Wouldn't it be more ...
[2 replies] Last: Seems a little off putting though. Thanks for the response. Now I know... (by Daleth)
Error?
 
Hey everyone, I'm getting an error using cout and I have no idea why. It occurs in both implementation files, can anyone help? #ifndef H_personType #def...
[4 replies] Last: Heh, Doh!! That solved it, cannot believe I overlooked that. Thanks y... (by yoked88)
random number generation
 
Hiya....A̶̲̥̅̊♍ kindof in a fix with a program A̶̲̥̅̊♍ meant to write.need some help please.the question is....write a program thatplays the game...
[1 reply] : Someone asked the same question here: http://www.cplusplus.com/forum/b... (by xismn)
who can explain? (reference)
 
#include <iostream> void func1(int &a); void func2(const int &a); int main() { double d = 5.5; //func1(d); error,,, why? func2(d); // ...
[4 replies] Last: thanks a lot xerzi (by Mher Didaryan)
by Niven
Collision Detection Help
 
I'm trying to create a general function for collision detection that I can use in a variety of my programs so I don't have to try to make one every time. I've a...
[4 replies] Last: Thanks for the code. I think with just a few modifications it could be... (by Niven)
UVa 10656- Maximum Sum (||)
 
Hello I've written the below code for Maximum Sum || problem. Here is the linke: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=sh...
[2 replies] Last: Yes I corrected that part but still getting PE. (by bmardanzadeh)
Class Templates
 
Ok so i had this code which gave me following output Elements in List: 2 3 4 5 6 7 8 9 10 11 12 Elements in yourList: -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 and th...
[6 replies] Last: It's a pity the opening post was edited so much that the original prob... (by andywestken)
C++ Template Question
 
I have tried the following code , it doesnt work #include <iostream> #include <string> using namespace std; template <typename T> T add (T & a, T & ...
[1 reply] : You'd be creating a temporary value (implicit conversion from int to d... (by closed account o1vk4iN6)
by coder1
something going wrong
 
if ((b !=-1) && ((y-1>=0 && b [y-1]==b ) || (x-1>=0 && b[x-1] ==b ) || (x-1>=0 && y-1>=0 && b[x-1][y-1]==b ) || (x+1<n && y-1>=0 && b[x+1][y-1]==b ) || (...
[2 replies] Last: its outputting YES 4 times but the 1 has no adjacent integers which a... (by cire)
Strange issue using input streams
 
I'm reading in a .txt file, the first couple of lines are: 5 Burglar Earthquake Alarm John Mary The first line is the number of variables which are lis...
[6 replies] Last: Thanks to both of you for your help, I've settled on another method th... (by Crakrjack)
ATM Machine Simulation Logic Help
 
If you were me and creating an ATM simulation program, what would you check first if the user have entered the amount he/she is going to widthdraw? The balance ...
[4 replies] Last: Oh I didn't read that properly. I was thinking there was a function fr... (by Olysold)
Wrapper object
 
Hi, I am trying to combine objects defined in third party's lib. 1) First of all, I want to perform the conditional operation like this: if(Selectio...
[4 replies] Last: Thanks for help ne55. I appreciate it. (by dkumar3)
Help using 0xDEADBEEF in a memory pool problem
 
Hello, I am working on a problem in which the an integer pointer is initialized to 0xDEADBEEF. It is allocated memory in my memory pool and then deallocated ...
[5 replies] Last: do not use it. In the release version it's uninitialized memory (by coder777)
by mr5
C++ removing chars from a std::string
 
What's wrong with my code: std::vector <unsigned char> _colors (QD * 20); struct RGB { RGB() : R(0), G(0), B(0) { } un...
[1 reply] : I would highly suggest using a debugger to look at your code step by s... (by Zhuge)
Conversion between char & string
 
Hi, I have a question on conversion between char & string. I have cut & pasted the part of the code from my C++ code and my function "decryptPwd" uses C sty...
[7 replies] Last: Hi All, Thank you very much for all the replies. I managed to combine... (by mathewfer)
error C2678: binary '=' :
 
I know that this is home work and I don't want no one to take duty to solve the problem.I want to know where is the error.Here is my code and I am can't figure ...
[2 replies] Last: no operator found which takes a left-hand operand of type 'const CStu... (by andywestken)
June 2013 Pages: 1... 1516171819... 28
  Archived months: [may2013] [jul2013]

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