General C++ Programming - December 2008 (Page 9)

by a786
what does this mean in c++
 
what does this mean in c++: for (;;)
[1 reply] : It's the same as while (1) (An infinite loop.) (by helios)
by Bollom
Problems in C++ Prime Number Checker
 
Hi guys, i have some problems with my program my program should ask user ton enter two numbers and then generate the primes between these numbers and o...
[1 reply] : Ironically your two problems are actually the same one. You need to... (by Buff Dogg)
Using a Flash Drive in FreeBSD
 
[1 reply] : Try a BSD mailing list or forum. This isn't a Linux/Unix support site (by Zaita)
input validiation
 
I am making a numbered menu system 1. caterer 2. decorate 3. entertain 4. quit how would i go about checking to see if the user input a letter? i keep ge...
[3 replies] Last: http://www.cplusplus.com/forum/articles/6046/ (by Zaita)
by Bollom
Problems in C++ Prime Number Checker
 
Hi guys, i have some problems with my program my program should ask user ton enter two numbers and then generate the primes between these numbers and o...
[no replies]
Declaring an STL list iterator in a class
 
I built a simple Queue class using the Standard Template Library "list" as the container for the Queue. My problem arises when I try to provide a member func...
[5 replies] Last: Thanks jsmith. I changed the line to _List_const_iterator<Type> it... (by Buff Dogg)
Templates and operator overloading
 
#include <iostream> using namespace std; const int DefaultSize = 10; class Animal { public: Animal(int); Animal(); ~Animal(){} int GetWeight() ...
[4 replies] Last: I tried the program and found that the second case will work if an arr... (by n4nature)
by tcyj86
c++ reading flie
 
I am currently working with a sample P2P program to share any type of files with others. A file is now divided into 5 parts and save 5 parts into harddisk befor...
[5 replies] Last: http://www.cplusplus.com/reference/iostream/istream/seekg.html (by helios)
Pointers and assignment and unpredictale result
 
I have a following code: void *result=GetCurrentApplicationHandler(); long *lngPointer=(long *)result; printf("\nlngPointer = %d",*lngPointer...
[2 replies] Last: Ok, setting aside the pointer cast magic and assuming it works, the co... (by jsmith)
by Alena
memcpy function
 
Hello, I have the following sequence: unsigned char buffer ; buffer = 0x00; buffer = 0x00; buffer = 0x20; buffer = 0x41; Then I copy memory to th...
[2 replies] Last: Thank you a lot :-) (by Alena)
Array with random non duplicate numbers
 
I need to create an array that has a fixed number (for example 30) of random non duplicate integers between 1 and 100. Any help will be greatly appreciated!
[3 replies] Last: Well, I would create the array, then each time you randomly generate a... (by firedraco)
Question about vectors
 
Hey guys, Just wondering how i would go about this problem. As you see I'm filling up a vector with objects of a struct knight. But I'm not sure how to get e...
[9 replies] Last: Cheers for that mate, but this is just a very small test program as we... (by Mythios)
Decimal to Binary conversion
 
I am writing a program to covert decimal to binary. This is what I have soo far... #include <iostream.h> #include <conio.h> void main(voi...
[4 replies] Last: You should be able to just call the function with the integer you want... (by jsmith)
Convert char to char*
 
Hello, this is my first post. My question is how would I convert a char to a char*. WHat I am do is making overloaded constructors that will handle differen...
[1 reply] : You have pointer ownership problems with your string class. When th... (by jsmith)
clear ctrl-z from buffer
 
I'm having a problem with our assignment this week. What I have is a function that has the user enter data into several parallel arrays(name,age,gender,gpa). S...
[4 replies] Last: myStream >> myNumber Is an overload and equal to istream& myStream.... (by Zaita)
trouble changing 1-D array into 2-D
 
I have a program for finding the grades in a class of 10 students that uses 1-D arrays. My code is posted below. How do I convert it into 2-D array? Below th...
[1 reply] : I don't think you are doing this correctly...I think what you want to ... (by firedraco)
exception handling core dump
 
#include<iostream> using namespace std; void a() throw(float) { throw 5; } int main() { try { a(); } catch(int a) ...
[2 replies] Last: Your throw specification on a() says the function only throws floats, ... (by jsmith)
qn regarding file closure problem
 
ok my lecturer is away and I need some help so here goes: Q1) in the constructArray() function, why is it that I have to do file.clear() ( after the reading ...
[14 replies] Last: I'm not sure you can without knowing a priori how many elements you ar... (by jsmith)
How to read other lines in a file?
 
Hey Guys, Quick question. I know how to do all the input and output with files to grab what ever chunks. But in some programs i'll see like this in a .conf f...
[4 replies] Last: Haha, cheers for that helios - you really have a lot of knowledge in t... (by Mythios)
keyboardmanger class
 
hi; Is there anyone to give me an example of using "keyboardmanger()" class for what key pressed in keyboard. Plaese help me very soon. Thanks...
[no replies]
December 2008 Pages: 1... 78910
  Archived months: [nov2008] [jan2009]

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