Beginners - February 2009 (Page 21)

strlen(), series evaluation, and for loops
 
basically, this is what i have to do: In case 1 for the switch (b) print a blank line, a line with the message:"Part I:" and a blank line. © Prompt the us...
[5 replies] Last: I really can't see, what you are doing in part two... did you get the ... (by mordekai)
Template issues
 
Hi everyone... here's my issue... This generic function is in Driver.cpp: #include "Driver.h" double Driver::average(const vector<T>& num) { ...
[4 replies] Last: Thanks again for all your help helios... You're explanation helped... (by erratiC)
Character Count != Character Count
 
I had to write a program to count characters in a file. Here's the working bit of that: while(infile.good()) { inchar = infile.get(); ++counter; } ...
[4 replies] Last: Ok, cool. Thanks for the clarification! (by seymore15074)
switch statment looping non-stop
 
Hello C++ members, I'm having a tough time with this switch statement of mine. You see when someone presses a letter instead of a number the program flips ou...
[1 reply] : How about you start by replacing that recursive call with a loop? Wha... (by helios)
by ozan
Once again a Pointer
 
Hi, I need 3 dimensional array but with this(code given below) format, This is for 2 dimensional. double **PDB; double PDB = new double* ; // if N is ro...
[1 reply] : Normally when you start getting lots of dimensions you may want to ret... (by anders43)
eror c2075-wont go away
 
im doing this example project, but i cant seem to figure out why visual studio 2008 keeps giving me error C2075-'Target of operator new()' : array initializatio...
[2 replies] Last: You could do this, though: Foo **f=new Foo* ; for (int i=0;i<n;i+... (by helios)
by dman
Which implementation of this code is safe?
 
Char and Charw are my typedefs of the irrlicht types "irr::core::wchar_t" and "c8(char)" Charw* temp2 = Char2Charw((Char*)text.c_str()); . . delete temp...
[3 replies] Last: does this re-cast create a new instance No. should i delete temp ... (by helios)
by Jaymie
Memory Reallocation
 
I have an array to a set size however I need the array size to change accordingly in Run-Time whilst keeping the previous array information. This can be done wi...
[1 reply] : Use std::vector. http://www.cplusplus.com/reference/stl/vector/ ... (by jsmith)
Vectors and Random Number Assign
 
vector<int> group1r; vector<string> group1; for(cnt=0;cnt<20;cnt++) { // Beggining of for loop group1r.push_back ((rand() % group1.size()...
[5 replies] Last: Just split it up to debug it. cout the results of the expression brok... (by seymore15074)
by Brad T
Dynamic arrays
 
Say I have an array with 5 "indexes": int array ; How can I turn that into a array later in the program without deleting what is already stored in the...
[3 replies] Last: You need to start off allocating your array dynamically. int siz... (by psault)
problems with class and vector
 
hi again every body i really don't know how it is hard for me to compile and run those problem that i think i understand. i have this code in my .hh file ...
[2 replies] Last: thanks man i did see that one (by tukuniata)
Function problem
 
#include<iostream.h> int function2.7(int a,int b) {int i=1;int power=1; power=power*a; cout<<"power="<<power; i+=i; cout<<"i="<<i; ...
[3 replies] Last: VC6 is old. Sorry, forgot to mention that a return statement would ... (by closed account z05DSL3A)
by ozan
pointer problem.
 
Hi, I am confused about pointer issue. #include <iostream> #include <limits> using namespace std; int main() { double *Pdb; Pdb = new dou...
[4 replies] Last: Thanks mordekai (by ozan)
FUNCTION
 
/*To find how many smilar numbers in array and which is it and To find sum of numbers in array by using functions*/ #include<iostream> int findsmilarnumber...
[2 replies] Last: for ( int i=0; i<count; i++ ) { for ( int j=0; j<count; j++ ) { i... (by djlethal109)
when reading data from a binary file into a structure, where does the data go?
 
Well for school I have a programming project to do. The program has to read in data from a binary file and then output it to look like this: ...
[5 replies] Last: Thanks for all the help helios. I now understand what you're saying. ... (by jadmacro)
setcolor() fucntion
 
Where can i get a table or smth. so that i can know which color and which background will the program output? Thank you.
[1 reply] : 'setcolor()' is not a C++ function, it's part of the runtime for a par... (by anders43)
error C2664
 
I'm having trouble with this part of my code and I don't know why. Maybe one of you guys could help me? void Stats::displayStats(int *aPlayer) { if(aPlay...
[3 replies] Last: Hey helios, you submited ate the same minute as me..... (by tluisrs)
by Brad T
myfile.write() not working
 
I have a file that is open for both writing and reading using fstream. However when I use myfile<<"text"; or myfile.write(); nothing happens with the file. ...
[1 reply] : Did you confirm that the file was actually opened (if (!myfile) then t... (by helios)
by pajo
winbgim.h
 
I have some problems when i try to set solor for an object for example: The following section of code should draw rectangle with a border of black and interior...
[3 replies] Last: ok thanks mate this was realy helpful!! (by pajo)
i couldnt compile this fuction what is wrong???
 
/*To find how many smilar numbers in array and which is it and To find sum of numbers in array by using functions*/ #include<iostream> int findsmilarnumber...
[1 reply] : First: You need to do one of the following: Place "using namespace s... (by QWERTYman)
February 2009 Pages: 1... 19202122
  Archived months: [jan2009] [mar2009]

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