General C++ Programming - October 2009

by helios
Generic function pointers
 
So, according to this: http://www.safercode.com/blog/2008/11/25/generic-function-pointers-in-c-and-void.html GFPs are void(*)(void). I tried this: typedef...
[7 replies] Last: That kind of stuff really annoys me...someday I need to make a wrappe... (by Bazzy)
by kenr
pointer char ** changing when returning from function
 
I have a pointer char** being passed to Change function below and it looks find when it returns, and prints the correct value "Tom". But as soon as I execute a...
[2 replies] Last: Thanks helios. If I change the function to the following it works. I... (by kenr)
Uniform random generator and Gaussian (or Normal) generator
 
hi , i am looking for a uniform random generator and gaussian(or normal) random generator. i want to generate integer numbers between [0 , RAND_MAX] . Do you kn...
[5 replies] Last: You're almost two months late. (by helios)
by netP
How c++ allocate memory for class member functions?
 
Hi, I am curious how c++ allocate memory for class member function. If I have a class like: class A { int n; void function1() {......} } ...
[2 replies] Last: I see. Then, there is nothing to worry about creating many functions i... (by netP)
Allocation of multidimensional array
 
Hello, I would like to make an array of n pointers to arrays of m integers. I see two options for initialization : - make n new arrays of m integ...
[no replies]
Comparison of Templated Data Types
 
Edited: Was missing a critical component of the assignment...sorry for the misfire!
[no replies]
by nrose
array
 
how do you save information to an array. i wrote a program to decode a .rle file and now i need to save it to an array but i dont know how. here is the code i h...
[1 reply] : Google arrays The above code just keeps changing the values of intege... (by buffbill)
array and frequency
 
I have come up with this code to print out a column of letters and another column of their frequencies entered but my code isn't working. Any suggestions? char...
[3 replies] Last: One way of looking at this is: 1. I think you need to do more work on... (by buffbill)
Program won't read data from text file
 
//I am having problems with reading the data from the file. It always outputs //"Invalid file name". I also am having problems with my print_Saverage //function...
[1 reply] : You're trying to open a file called "filename". You need to specify th... (by bluezor)
Need to make a triangle with varying width and height
 
* * * * * I need to make that and let the user pick the height and width, any ideas? Thank You
[3 replies] Last: Have you tried mixing up your stars * with blank spaces " " using 2 fo... (by buffbill)
by AndyRo
Borland C++ Builder 6 / 64-bit compatibility
 
Hi, everyone, I'm new here and I would really appreciate it if you could help me out with some doubts. Would Borland C++ Builder 6 work on a 64-bit OS? If...
[no replies]
by tition
question about memory management of classes
 
Hi all, I have the following two options for realizations of a class LargeInt that is supposed to hold unlimitted in size integers. Option 1. class Larg...
[2 replies] Last: Thanks jsmith! Cheers (by tition)
Which is faster?
 
Hi, which code executes faster: Example 1: counter = (counter + len) % BUFSIZE; Example 2: if ( (counter = (counter + len)) >= BUFSIZE ) { c...
[6 replies] Last: Choice of assembly or C doesn't matter. But you are exactly correct: t... (by Duthomhas)
Virtual / Class Inheritance Questions
 
I have a programming test tomorrow and I have quite a few questions about virtual functions and class inheritance. If anyone that knows these two things quite w...
[1 reply] : Why don't you just go read the tutorial and post specific questions wh... (by kempofighter)
List Program
 
I am trying to write a program with lists that stores student id's, names, resident status and credit hours. The program is supposed to accept input as long as ...
[3 replies] Last: If you have the time, take a look at this article. I wrote this artic... (by kempofighter)
Vehicle Insurance Program
 
I have most of the code for the program but hit a snag. If anyone can, I would greatly appreciate someone to look over the following and see what I may be missi...
[4 replies] Last: In double accidentAjust(double accidents, double& premium) , control ... (by bluezor)
by luther
comparing problem
 
im trying to compair the times in the prt array. the llogin works fine however the flogin does not. what is causing the problem given the following time.cpp...
[1 reply] : Your LessThan and GraterThan functions are both wrong. Think abou... (by jsmith)
by minix
Debugger
 
Hi, I want to make a debugger for my application. which also print line number and and file name. and also accept variable argument list. We don't need t...
[6 replies] Last: Hi Guys, Finally I found the solution. anyways thanks for your help.... (by minix)
Conway's Game of Life, using file stream/arrays--not working properly?
 
EDIT: I fixed it. Nevermind. So, I have an assignment to do that involves arrays and the Conway's Game of Life. We were advised to use file streams for thi...
[no replies]
by nrose
decoding
 
how do i change the program i have to use an ASCII file for input instead of asking the user??
[1 reply] : int integer; char character; int characterperline=0; do { ... (by nrose)
October 2009 Pages: 123... 17
  Archived months: [sep2009] [nov2009]

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