General C++ Programming - October 2008 (Page 2)

Template classes and static variables
 
I've recently come across a template class, which contains static data items, and was wondering how a compiler allocates storage for the static data in this cas...
[1 reply] : Memory for templates is generated at compile time because the compiler... (by Zaita)
by Sb1
Random integers
 
I'm making some kind of card game as a project and I need some way to make a random integer so I can set the suit and face for the cards. I'm not asking for ...
[3 replies] Last: Make sure to use srand() to seed the generator. (by Zhuge)
Int and Doulbe logical problem. (1,2)
 
Hello. Yesterday I was learning about double floating points, and I decided to just write a simple code to try it out. Now I know that if I use "int", I can...
[26 replies] Last: Because you could want it to be overwritten, if you don't just use +=... (by Bazzy)
ISO C++ forbids declaration of 'i' with no type
 
#include <iostream> using namespace std; int main() { for (register i = 1; i <= 9; ++i) for (register j = 1; j <= 9; ++j) cout << i << " x " << j ...
[3 replies] Last: As said before: always use iterator of integer type or special iterato... (by Repentinus)
advice/assistance using functions
 
I have to write a program that calculates the perimeter, semiperimeter, area and centroid of a triangle using coordinates input by user. Some of the requirement...
[1 reply] : well, for your first question, you need to create a variable in main t... (by grcunning)
Complex number problems !!
 
I am working on a problem to find the discriminant of the quadratic equation b2-4ac and have encountered difficulties in finding the complex solution when the d...
[3 replies] Last: std::complex is the C++ standard type for complex numbers. My ques... (by exception)
Collision rate in a hashing function
 
I am working on a program for a class and it requires me to find the collision rate after some inputs are hashed into tables of various sizes. I am unsure how t...
[1 reply] : Sounds like it is just the percentage of inserts that cause a collisio... (by jsmith)
What am I doing wrong? (code problem)
 
I need some simple help. I have created this program code that I will show. Here is the problem. The first time through, in the middle of the program it asks fo...
[3 replies] Last: this problem was also posted in the beginner's forum. It has been res... (by grcunning)
Making a argument optional to function
 
Is there any method to make the argument of function optional? means if user don't give its value in calling the function, then it should not do any effect on t...
[4 replies] Last: You can also declare different functions with the same name but differ... (by Scipio)
trouble with char variables -- transfering them to another variable name
 
I have a program I am writing and it goes through a text file that has a name and then a number over an over again. I'm just trying to get the output to display...
[2 replies] Last: A couple of things, like scipio said, you shouldn't use c style char n... (by grcunning)
How do I do this?
 
I have an assignment for my programming class that requires me to " use switch in this exercise) Write a C++ program that asks for a number between 15 and 256....
[2 replies] Last: try to define your problem in the title, don't put things like "help m... (by grcunning)
determining prime numbers
 
hi all.... could you help me... with this, Write a program to show prime number from an input number. Range input number is 1-999, if input number is not i...
[4 replies] Last: servalsoft, thanks for that links. Seeing so many post asking this que... (by Cerburos)
Anybody Know what this is doing?
 
#ifdef WIN32 #ifdef THU_EXPORTS #define THU_API __declspec(dllexport) #else #define THU_API __declspec(dllimport) #endif #else #define THU_API #endif ...
[4 replies] Last: Yes it is, it's part of a header file.....but then later down the file... (by amoore105712)
using tne enum ??
 
class Place { public: enum Type { PLACE_CONCERT_HALL = 1, PLACE_THEATRE = 2, ...
[1 reply] : I think you should delete Place:: when declaring type ... (by Bazzy)
by lolla
solve my task
 
hi for all who will read my msg...our instructor in the university asked us to do the folowing task: " print your name via a windos application in c++ on a pap...
[3 replies] Last: @zhangok: Is this some sort of joke? Have you read the link Zaita post... (by Scipio)
Can C++ be used for hardware-level programming?
 
I mean, can I... -Make a program that can run BEFORE Windows loads? -Make that program run checks on the hardware and return the results? Or is that strict...
[2 replies] Last: You can write an OS kernel and any device driver in C++ (although you ... (by exception)
What am I doing wrong?
 
accidental repost
[no replies]
drawing an animated cartoons(beginner)
 
Hi everyone, I am new to the programming world. I have a big trouble of doing my homework and I really need your help. My goal is to make a short animated carto...
[1 reply] : http://www.cplusplus.com/forum/articles/1295/ (by Zaita)
comparing stacks
 
How do you overload the == operator in a stack?
[13 replies] Last: Then start digging through the source code to your compiler's STL. Hav... (by Zaita)
command for compile c to library
 
My c compiler is : Turbo C 3.0 My OS : Windows XP I want to link function in C to Java programming by using Java Native Interface (JNI). But the problem ...
[1 reply] : err.. Some details of your error might be useful don't you think? (by Zaita)
October 2008 Pages: 1234... 11
  Archived months: [sep2008] [nov2008]

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