General C++ Programming - February 2009 (Page 7)

Urgent: Generating random numbers WITHOUT repetition
 
Hello. May I know how to generate random numbers where all the numbers are different, without repetition? I am using randomize() and rand(). Thank you!
[8 replies] Last: //RANDOMIZE : BY Atul int n = 10, r, result; int getRandNum ; i... (by atul bajaj)
by g0dwyn
[SOLVED] segfault on New (mild necro)
 
Hey all, I saw that Helios was having a similar problem to what I'm experiencing, and figured I'd bring it up again Helios, when you posted this question:...
[3 replies] Last: Wow. Turns out it was all caused by a simple decrement in a recursive... (by g0dwyn)
PROBLEM PASSING ARRAY TO A FUNCTION
 
I get the following error when i try to pass an array (of char type) to a function 'UNDEFINED SYMBOL (NEAR*,INT) IN MODULE filename.CPP' function definition i...
[11 replies] Last: I wasn't pointing to Matt's code, I was pointing to the OP's. Matt's h... (by Garandy)
Struct questions
 
I'm writing up a video-game engine right now, and for the tactical combat grid, I was thinking up ways to store the relevant information for each grid square (d...
[no replies]
how to do this using string array
 
Hello, i wan to do c++ program in ubuntu that able to write a summary on the directory example is drwx-x John 4096 d-w--x ...
[9 replies] Last: Hey! Sorry for not replying for so long. Anyways if you'll just use ... (by kevinchkin)
extern and unresolved external : I'm lost
 
Hello all I'm facing a very puzzling issue : an array of const std::string values is never seen by the linker : source1.cpp #include <string> ex...
[2 replies] Last: You are not linking both source1.obj and source2.obj into the executab... (by jsmith)
[SOLVED]Adding some form of FPS?
 
Well basically I had to recreate the game space invaders for a task today. The game it self comes out fine. But one of the tasks to implement is "frames per sec...
[11 replies] Last: That depends on the threading library. Typically something like Thr... (by Zaita)
by Karami
[solved]multiple definition of `sakums(int)'
 
hi, i was writing some basic programs and linking them together in 1 big program but when i decided that i want to have some functions posible in many files(pro...
[3 replies] Last: Include guards work for multiple declaration, your problem was having ... (by Bazzy)
two-dimensional array and function
 
Hi, Actually I'm using C, not C++ but i think the codes are just about the same that's why i joined this forum. Hopefully someone could help me. #include ...
[2 replies] Last: Hi Bazzy, You're right. I just changed the function variable to cu... (by whacked)
by annliu
computer ebooks free download
 
Hi,there are many computer ebooks free download. [url=http://www.51cnnet.net]free ebook download
[no replies]
String Radomization
 
I am trying to randomize an array of strings. ex(like in a mad lib program) I have them declared as // CODE string callType = { "Beginner", "Intermed...
[9 replies] Last: Yes, it's right. You don't need parentheses around 10 when pos... (by Bazzy)
error C2078: too many initializers
 
I want to change this to use user defined functions working on the first and i get this error, not sure how to fix it. #include <iostream> using namespa...
[4 replies] Last: *Never* but the else statement in the same line as the if statement. I... (by helios)
Trouble converting a program into user-defined functions
 
Well, I had this code done to find the biggest number out of a set amount of numbers and one to get smallest out of an unset amount of numbers and I need to cha...
[12 replies] Last: oh wow didn't even copy the right program oh well (by Bishopssix)
by tition
an inheritance and template class riddle...
 
Hi all, Just got an interesting piece of tangled code involving template classes. It compiles and links (have not yet tested whether it runs properly). Can i...
[no replies]
Prevent "^C" from appearing into console?
 
Hi all, could someone tell me, how can I make my C/C++ program be stopped by pressing Ctrl+C and not seeing "^C" later? I do by void sig_INT( int a ) {...
[1 reply] : That's handled by the console, not the program, so it's not possible t... (by helios)
Modifying array with probability
 
Hi, I'm implementing an algorithm and it asks to modify a 15x15 2d array with a certain probability (0.1). How exactly do I implement this? The modificat...
[1 reply] : By probability 0.1 you mean 10%? Generate a random number in the ra... (by jsmith)
ECCENTRIC PHENOMENON when passing values
 
I came to an eccentric phenomenon when running my program. My process accepts TCP connections and then reads data from the socket. It had been worked allrigh...
[2 replies] Last: Thanks for you reply. the binary file would be rebuilt for every prod... (by KenSoGCN)
still problem with UNICODE
 
hi, pls help me with unicode problem here is my programm #include <iostream> #include <wchar.h> #include <windows.h> #include <iostream> #define _U...
[1 reply] : UNICODE (not _UNICODE) must be defined before including windows.h, and... (by helios)
by pczi
changes to xpdf
 
Hi all, I want pdftohtml (http://www.foolabs.com/xpdf/download.html) to output a placeholder/marker for Path/Picture commands. This is useful for "OCR" on ...
[no replies]
Reading data in .txt format
 
Hi there, I been trying to create a way to read data that is stored in .txt format. I have tried to use fopen and fread, but it since like they are not pick ...
[4 replies] Last: The very first line of your posted program code... is the '/*' really ... (by eker676)
February 2009 Pages: 1... 56789... 14
  Archived months: [jan2009] [mar2009]

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