Re:
Below is my code for printing prime numbers up to a given input by user. However, my calculations are not working correctly and my output is printing twice. Any idea? :sad: #include <iostream> #include <cmath> using namespace std; void prime_num(int); int main() { cout << " Enter a number and … |
|
Re:
hey how to clear the screen in c++ i m using dev c++. clrscr()doesnot work |
|
Re:
hey, i was wondering what is the best idea for a computer science project to be done, i thought a 3 D virtual city will be very helpful for tourism and educational purposes, its also fun to program. does any one have better ideas? ;) |
|
Okay, I'm making a shooter game, and all my weapons are differnt userdefined objects; ie. the flamethrower works differently then the gun, however, I'm calling some functions in my "main", an example of this would be; [CODE] /* <Init> */ MachineGunClass *CurrentWeapon; MachineGunClass *MachineGun; MachineGun = new MachineGunClass(); CurrentWeapon = … |
|
Re:
Hi everyone, I just can't seem to find an explanation for using this "->" in code, in C++. I've migrated from Java and C#, and haven't seen this notation before. Basic example: [CODE]CMesh *pMesh = WorldObjects[i]->m_pMesh;[/CODE] As best as I can tell, this is the C++ equivalent of C#'s [CODE]WorldObjects[i].m_pMesh;[/CODE]. … |
|
Re:
hi im working with opengl/sdl and im still new to it what im trying to do is to make a 2nd box or sprite that will follow the frist box ive made can anyone help me out here is some of the code i have [CODE]#include "sdl.h" #include "GL_Functions.h" #include … |
|
So I've got this program I made, and I wanted to speed it up, using multithreading, to make use of my quad core. The program itself fully supports multithreading. The problem is, that when I'm running the program, using just one; CreateThread() it finishes in 6seconds, if I run 2 … |
|
So I'm working on this class, which is basically to wrap a char into 8bools, and it works so far, however I'm running into a problem, in the dedication of values, since I'm to use the overloaded array operator, as well as the overloaded assignment operator, at once, however I … |
|
So I've been working on two small programs to calculate prime numbers, fast and memory efficiently. Both my algorithms are based upon the 'Sieve of Eratosthenes', and I know that the 'Sieve of Atkin' would be the way to go since its faster, however I'm just trying to optimize the … |
|
So I'm working with OpenGL, and DevIL to load some JPEG into my program, and I've had some trouble, I've isolated the program in a simple sample program (uploaded), the program is, that when I load the standard file, that came with the guide ("Geeks3D.jpg") it loades instantly and runs … |
|
So I'm working on this game, and I've been using "glaux.h" to load my textures, however I'm interrested in using JPEG's, so I found an example to do this on: [url]www.morrowland.com[/url], however, when I compile it (after fixing the errors), then I get this, on the linking state, any help … |
|
Re:
in Windows Task Manager --> Processes there is a list of running exe files. I am going to write a program that lists these running exe files. How can I obtain the list? I use Windows XP :$ & Windows API!:) |
|
So I'm quite new to c++, and I'm really into pointers, does anyone got like, an idea on how to really get to know pointers, assignments, tasks, tutorials, ect. Basically, my knowledge in C++, is classes, operator overloading, and like simple stuff, so if you're able to come up with … |
|
Okay, I'm making a game, and I need to use random inside a class, however I can't figure out how to seed the randomness into the class, so atm I'm getting the same random each time. I've tried stuff like srand(time) in main, however, that doesn't apply to the class, … |
|
I'm making this snake game, and I've created a class to handle the snakes (players and AI snakes), this works out quite well, however, at the moment I'm declaring my main snake (player 1), as global, in terms of: [CODE] class Snake { //... Lots and lots of code. } … |
|
Re:
I am trying to write a program to find nearest prime to a number to its left...using for loop i just don't seem to get it right [CODE] #include<iostream.h> #include<conio.h> void main() { clrscr(); int n1,flag=0; cout<<"Enter The Number"<<endl; cin>>n1; for(int i=n1;i>0;i--) { for(int j=2;j<(i/2);j++) { if(i%j==0) { flag=0; } … |
|
Re:
Hey, I've got an assignment from my computer teacher in school. I've got to make a program that displays the prime numbers in a range and also display the number of prime numbers that are present. And i'm only supposed to use the basic header files.....that means the program should … |
|
Re:
Long story sort, I'm making a thread in c++ that starts a timer. When a user starts playing the game, it starts the thread, and when user logs out - thread stops. - thus giving me the total time played. Problem: When using the code to start the thread - … |
|
Re:
can I open a file and then close it in a loop? I tried but it doesnt seem to work. :( |
|
Re:
Hello, i already have C++ class few month , but i still find difficult to write the problem analysis on this project ... This is my question ... "Problem Specification A small scale Airline Company bought a new computer to computerize their airline ticket booking system. The company’s CEO asked … |
|
Re:
how do i display something like this using for loop? 0 2 4 6 8 10 12 14 18 24 26 28 30 32 thank you for helping... |
|
Re:
Dear All I would be very happy if you could help me! I need to create a main() program which is be able to; * reads in a list of words and their associated meanings from the given test file(file.txt)(This file contains 10 lines) * provide an interactive menu interface … |
|
Re:
Help!!! I'm trying to eliminate the highest and lowest number out of 5 inputs then get the average of the remaining 3 inputs... In some instances, it gives me incorrect average.. (We are not suppose to use arrays yet) Here's my code: #include <iostream> using namespace std; void getData(double& input1, … |
|
Re:
Hi, this is one of my hw problems for the week and having trouble writing this code.-- QUESTION: 1. Create a program that will generate a 10 question math quiz for single digit addition. Your program should create 2 random numbers in the range of 0 – 9 and then … |
|
Re:
Hello, I am currently doing a research at my university about the ways in which we can use multicore CPU to enhance graphics performance instead of putting all the load on the GPU, I am trying to work with both OpenGL and OpenMP and I am planning on using gDebugger … |
|
Re:
This is basically my code. It says build succeed, but I get nothing. What am I doing wrong. The user inputs a sentence, for example, Hello. (I've taken out other parts such as return LOWERCASE, return DIGIT, and what would happen in those cases for ease of reading). The program … |
|
Re:
Hi, I'm trying to encrypt a simple .txt file. What I want to do is is described by the function definitions. I want to change all my characters in the .txt file to lower case and then convert any digits found into *. I've done this before in the past, … |
|
I've been having some thought, like, if I run a program, and I'm exporting a pointer to a variable "a" to a file, and I reads that information with another program, wouldn't the second program be able to modify "a" in the first program using that pointer? - Like the … |
|
Sorry for doing this, but anyone with GLUT experience willing to look though a little code, since it's not working at all; I posted the thread here: [url]http://www.daniweb.com/forums/thread235691.html[/url] |
|
Re:
Hi, So i have written my code to solve the quadratic equation and it works. The thing I need to do is to read values for 3 variables from an input .txt file until the end of the file and output the answers for each set of variables. The variables … |
0 Reputation Points
~16.6K People Reached
Favorite Forums
Favorite Tags