Beginners - September 2011 (Page 43)

what is wrong with my randomizing a number?
 
im just trying to generate a number 1-4, declare a 'creature' for that number, and then display its stats my error is on line 59 attempting to generate a num...
[1 reply] : If generate_random(int) returns an int, then you should have assigneg ... (by piotrekd)
by wasabi
getting bad_alloc from new
 
I'm running a program and am getting a bad_alloc exception from new . The problem is not that I've run out of memory, my program isn't that resource-intensive....
[7 replies] Last: Just found my error. In a previous part of the function, I had a stati... (by wasabi)
can you help why wont this compile? help
 
#include "stdafx.h" // This is for MY compiler remove this if the program does not compile. #include <iostream> using namespace std; int main() { int n...
[5 replies] Last: You can omit the stdafx header by deselecting the Pre-compiled header... (by closed account zb0S216C)
OR Operator
 
This may sound a bit absurd but how the heck do you get the OR operator character on a British layout keyboard. The symbol appears to be on the key next to the ...
[1 reply] : Erm nevermind. Turns out although the symbol is on that key it only o... (by myristate)
New with classes. Could someone please look at this prgm.
 
I'm trying to write a program using classes (you don't need classes to write this program but I want to acquaint myself with classes) that outputs a students le...
[1 reply] : Could someone please comment on my code. I want to know anything wrong... (by bool maybe)
Monthly Payments
 
The monthly payment on a loan may be calculated by the following formula: Payment = (Rate * (1+rate)^n)/((1+Rate)^n - 1) * L Rate is the monthly interest ...
[4 replies] Last: You can easily do that with right manipulator. Its in the link I gave ... (by Undeclared)
by PeterK
Write 2D Array to binary
 
There are a lot of tutorials and stuff about how to write data to a .txt, but none of them really helped me. I made a program that is supposed to convert integ...
[10 replies] Last: Well, everything works. It saves the files and correctly loads them ag... (by PeterK)
specify to have dynamic size of a value
 
For example, I'm creating a class of say pixel. This pixel could be part of a grey scale image that has 256 shades from black to white so it could be represent...
[4 replies] Last: I'm in a digital image processing graduate course. We can't use any i... (by closed account S8hvC542)
by Beep
Baby steps!
 
#include <iostream> using namespace hello; cout << "Coming from Python background, and I need someone to shoot in my leg !!"; Thanks to all this great tutor...
[3 replies] Last: C++ is indeed a very interesting language. Wish you best of luck with ... (by Undeclared)
How can I clean my screen?
 
I've created an application in C++ (I didn't think was necessary to post the code) and at a moment I had to clean my screen. I knew the function clrscr() from t...
[4 replies] Last: Thanks a lot friends! Nice forum, by the way! I am glad to be part of ... (by CosminNTG)
Template class file organization
 
Hello: I am new to template programming and trying to implement a simple toy template class with Visual Studio 2010. For the sake of clarity, I would like...
[4 replies] Last: Thank you Shacktar. The code is compiling with the separation model. ... (by hoplalos)
question about file proccessing
 
Hi guys. Can anyone explain me this: #include "stdafx.h" #include<fstream> struct A { string a; string b; int i; }; int _tmain(int argc, _TCHAR* ...
[no replies]
Convert Image to Matrix
 
I want to convert image(ex .bmp or .jpg ...) to binary matrix. When image was loaded,I want to convert it to array as a matrix.At black point is 1 and white po...
[1 reply] : In Windows you can use GetDIBits() (http://msdn.microsoft.com/en-us/li... (by webJose)
i got the very basics, how sould i continue?
 
Hi, I have been reading a book and helped me allot! So far i have covered: -Types, Variables, and Standard I/O -If Statements, branching and Looping Sta...
[6 replies] Last: Thanks for the compliment :) I have just started working on it and wou... (by Undeclared)
by jrmma
assignment operators
 
is the following code correct?: if(0!= variablename) { ... }
[6 replies] Last: OK Thanks a lot.. So basically they are the same right? " if(0==var) "... (by jrmma)
learn more pointer.......
 
#include<stdio.h> float * display(int,int); int max=5; int main(){ float *(*ptr)(int,int); ptr=display; (*ptr)(2,2); printf("%u",ptr); ptr=p...
[1 reply] : Because of this: ptr=ptr+1; ptr is a pointer to a function. What... (by Moschops)
Calling variables from other functions
 
Hey guys something I'm not sure how to do is to use a variable defined in a function in an entirely separate function. In this case I'm trying to get the length...
[6 replies] Last: That means that there's no matching function prototype in the class de... (by shacktar)
function.....
 
#include<stdio.h> #include<conio.h> float * display(int,int); int max=5; int main(){ clrscr(); float *(*ptr)(int,int); ptr=display; (*ptr)(2,2); ...
[1 reply] : 1. Don't return pointers to local objects. The objects go out of scope... (by helios)
basic 4 slot seat reservation
 
hello, i'm trying to program a 4 slot restaurant table code with a bool loop. I do not know how to make it so that if someone selects seat 1, the loop repeats ...
[3 replies] Last: ok! i got it down! turns out it was in the next chapter of my book. ... (by maharris)
by hydroJ
Function prototype problems
 
not exactly sure what I am doing wrong here... advice? //****************************************************************** // LeapYear program // This progr...
[4 replies] Last: that did it. thanks. (by hydroJ)
September 2011 Pages: 1... 4142434445... 48
  Archived months: [aug2011] [oct2011]

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