General C++ Programming - February 2012 (Page 27)

by NoClue
How do you randomly choose a function?
 
I'm new to C++, and not very good in it, but I'm trying to create this mini game and I need the system to choose a set of functions randomly. I've seen posts ab...
[5 replies] Last: Yep, that script fixed it. Before the output was claiming there was a ... (by NoClue)
Write a C++ program that uses an array determine and display the prime numbers between 2 and n
 
Hi,i need to write program to print prime number between 1 to n(user input),please give me outline :) I have absolutely no idea :( Write a C++ program that...
[10 replies] Last: Hi, I'm not going to solve the whole problem but just part one (a); ... (by therockon7throw)
Own Programming language
 
How can I create my own programming language with c++. Things that I need to know: How to make the syntax, for example, make void hi() { cout << "hi" } ...
[8 replies] Last: Seriously i wouldn't recomend boost::spirit for a c++ beginner. It's f... (by aquaz)
Frame Per Second Didn't Update
 
#include <sstream> #include <SDL.h> #include <SDL_ttf.h> #include "KD_Surface.h" #include "KD_Message.h" #include "KD_Sound.h" #include "KD_Timer.h" ...
[1 reply] : event_handler() will hold on your program until you close it. (by ne555)
Issue
 
I have written this sort algorithm for a number of given integers from a file. The problem is that it sorts the numbers in an ascending order. I want the vice-...
[2 replies] Last: Thanks a lot blue :) It's great! (by jumper007)
dietlibc issue
 
Hi All, I am reading dietlibc library written by Dotchland guy , in lib\atoi.c file ,I found the code as (unsigned int)(*s - 9) < 5u , I do not understan...
[1 reply] : Sorry, I got , I just queried Ascill table, \b = 8 \t = 9 \n =10 ... (by misserwell)
function overloading
 
Hi , I am little bit confused over the fact as Why is function overloading used ? When i googled the topic on function over the function overloading ,it only ...
[9 replies] Last: Thanks all ... (by bluecoder)
SDL Initialization ! About Memory Consuming.
 
main.cpp int main(int argc,char *argv ) { if( initialization() == false ) { return 1; } event_handler(); clean_up(); return 0; } ...
[1 reply] : ...and? What's the problem? You make it sound like 4 MB is a lot. W... (by Disch)
by nick24
Magic Square Code
 
Operator Overloading: You need to overload the operators : '+' , '-', '!' to swap the matrix as follows: '-' : to swap all the horizontal numbers in the matri...
[1 reply] : You could store each matrix as a vector of vectors and then manually c... (by blueeyedlion)
Run C++ code inside a file.
 
I'd have a text file,contains C++ code. How can I,in the main(), read the file and treat it as header (I mean read and compile that code) ? Just asking,becaus...
[3 replies] Last: You need to include that as a header. (by clanmjc)
by Kourt
Union of two linked lists
 
I'm having trouble with my program where I have to print out the Union, Intersection, and Difference between two linked lists. I haven't even started on the Int...
[no replies]
IS THERE A FUNCTION FOR CONVERTING A STRING TO UPPERCASE
 
OK, Here is the problem, I need to know is there is a string function that can convert the whole string into uppercase instead of the function toupper(char) whi...
[11 replies] Last: Yay! (by Duthomhas)
File IO (.gdp) file type
 
hello, I am working on a robot and for that i want to read the file produced from a handheld GPS device. how can i read the file of .gdp format ? I am usi...
[no replies]
will this generate a random number correctly
 
I'm trying to generate a random number between x and y. Will this do what I want without significant biasing? #include <iostream> #include <cstdlib> #inc...
[5 replies] Last: Yoinks! Sorry I missed that! (by Duthomhas)
is this style ok ?
 
KD_MESSAGE::KD_MESSAGE( const KD_MESSAGE& copyMe ) { if( this != &copyMe ) { msgColor = copyMe.msgColor; msgFont = copyMe.msgFont; msgSize = copyMe.msg...
[2 replies] Last: Yay ! Thank you ! (by hentaiw)
Damn you, Euler...
 
So I had never come across Project Euler before, but now I'm hooked. I breezed through the first 10 but I think I'm making a logic error I can't spot on #11. ...
[2 replies] Last: Nice. Defeated by typo!!! Thanks for the heads up. (by Texan40)
return by reference : what's different here ??
 
Hi guys, i've two functions declared like the following. int& readRef(int& num){ return num; } int readNormal(int& num){ return num; } I thought the fun...
[8 replies] Last: @mtrenkmann Then I don't understand why you came up with things like ... (by therockon7throw)
File stream seekg() does seem to be working.
 
Hello, I use g++ on Ubuntu. I open config file somewhere, then when I call GetInteger() function for the first time it works fine, when I call it second t...
[2 replies] Last: ah, I have to clear() first. thank you! (by vincegata)
Combine SDL & Console Code ( 2 different main() ) ?
 
#ifndef KD_CHARACTER_H #define KD_CHARACTER_H #include <string> #include <fstream> #include <iostream> class KD_CHARACTER { public: KD_CHARACTER( ...
[1 reply] : For some stupid reason SDL on Windows redirects stdout to file. A quic... (by Peter87)
Why can't I access any members?
 
Within my main function I instantiate one of my classes like so: List sortedList(); The List class has a constructor with no parameters. When I try to use t...
[1 reply] : Hi First of all you dont need () so it should be like List sorted... (by therockon7throw)
February 2012 Pages: 1... 2526272829... 43
  Archived months: [jan2012] [mar2012]

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