Beginners - August 2011 (Page 11)

by andy8
Please help me with the 'logic' of this program
 
Hello All, The question that I am attempting to work out is as follows : "A government research lab has concluded that an artificial sweetener commonly us...
[2 replies] Last: Please don't double post. http://cplusplus.com/forum/general/49158/ ... (by cnoeval)
by wtf
How does new allocate memory for user defined types?
 
Say you have a pointer of a variable sized user defined type. (That is to say that it itself has a non const poiner data member, whose size can change). H...
[4 replies] Last: What is a shared storage mechanism? ... Sounds complex It could do.... (by andywestken)
by DouDou
Debug Version Giving different answers than release version
 
Unless i am crazy, but the debug buid of my code in visual studio give the "right answer", however the release version gives the incorrect version. Any reason t...
[3 replies] Last: Thanks for replies, The code is really long and complex so (10000 l... (by DouDou)
The assignment operator of Array1D < Array1D <T> >
 
Hi all, I wrote a class Array1D which is of the form: template <class T> class Array1D { int n; //Length of the array T* pointer; //Pointer to the ...
[3 replies] Last: You're welcome. No problem. I see that Array1D < Array1D <double>> i... (by closed account D80DSL3A)
problem sorting
 
#include <iostream> using namespace std; void ExchangeSort(apvector <int> &mylist) { int i, j; int temp; // holding variable int num...
[6 replies] Last: i dont know how to thank you, sir! i am sorry if i directly asked for... (by fartofagony)
Arrays
 
There are a few errors in this which i cant find out. Could you please help me? #include<iostream.h> #include<conio.h> #include<ctype.h> void main () {clrs...
[1 reply] : enclose your code in [code ] tags and provide us with the line # in wh... (by georgewashere)
Problem with GetKeyState();
 
I have a problem with this function: int getkeys() { goback: DWORD begtime=GetTickCount(); DWORD endtime=GetTickCount(); while(begtime+10>endtime) \\ Stops t...
[no replies]
Even or Odd
 
In C++ Beginners Guide by Herbert Schildt program tests if number is even like this: #define EVEN(x) (x)%2==0 ? 1 : 0 //... if(EVEN(x)) cout << "Even!" <...
[3 replies] Last: (condition) ? (value1) : (value2) is a test expression that returns... (by Intrexa)
code translation
 
In putty ssh.c source code line 5645 s->K = dh_find_K(ssh->kex_ctx, s->f); Can someone explain me what this code line means? What does the arrow point ...
[2 replies] Last: The "arrow point right" is the indirect member reference operator. s a... (by closed account D80DSL3A)
Having Unknown Troubles
 
cannot figure out what is wrong with this code: void play(){ cout<<""<<endl; srand ( time(NULL) ); r = rand() % 6 + 1; cout<<"Your total is "<< t <<...
[8 replies] Last: thanks disch! and sorry the program was too big to be posted so i only... (by Sellias13)
by Zephni
Console window to always have focus
 
Hi guys, please remember that i know very little about C++, so detailed answers are greatly appreciated =) I have made a small C++ program that takes in key...
[no replies]
Need to get() in a vector containing objects
 
Hi! I need to use the Get() functions I wrote for a class. However I use a vector to create and store the objects of that class(need alot of them). So, I wonder...
[no replies]
by tonnot
Need a short tutorial about create and delete objects.
 
Hello everybody: I'm still a little confused with the create-delete steps for objects, vectors, etc. I think every begginer has the same doubts, so the answers ...
[1 reply] : 1: Yes. Objects created with new must be deleted using delete when t... (by Athar)
a question about the size of a char array
 
Hello guys. Please explain the following: #include<iostream.h> #include<conio> #include <vcl.h> #pragma hdrstop //----------------------------------------...
[2 replies] Last: Thank you very much, Moschops (by andreychernukha)
hello, could i get some advice?
 
ive recently started programming again, and as i had been told a long time ago, im trying to program a copy of the game mastermind. currently my code is suppose...
[2 replies] Last: I'm sure nobody's time was wasted. Also, consider using arrays (thi... (by shacktar)
Small string problem VS2010Express
 
Hi. I'm new to C++ and programming in general. I'm in the process of working my way through the C++ Language Tutorial from this site and have run into a pesky b...
[4 replies] Last: Yep that fixed it. :) Thank you for your quick replies. Greatly apprec... (by lliwlli)
Boolean logic troubles?
 
Hi everybody, here's a sample program I wrote to show you what I don't understand. I'm making the user input an element from the periodic table, but I want it ...
[2 replies] Last: Oh, I actually knew that, wow, I feel stupid, well thanks anyway sohgu... (by VanPepto)
Formatting strings
 
Is there a simple way to format a numeric string such as "100000" to a string type like "1,000.00" in C++? I appreciate any example.
[2 replies] Last: If you are going to do it for this stand-alone formatting, it is ok bu... (by sohguanh)
by ty98
use a file
 
hy its me agin! I need to know how to get a program to use a file. Not lick pictures like text frome a text file. Do you have eny ideas?
[7 replies] Last: ty disch(: (by georgewashere)
C++ beginner exercise problem!
 
This is related to the beginner exercise I found on this site regarding functions. The question goes something like this: Design a user defined function c...
[9 replies] Last: Thank you very mcuh andy & vince, I used vince's solution since the ex... (by georgewashere)
August 2011 Pages: 1... 910111213... 39
  Archived months: [jul2011] [sep2011]

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