2,712 Posted Topics

Member Avatar for cougarclaws
Member Avatar for vinnijain
Member Avatar for cougarclaws
Member Avatar for mrnutty
0
102
Member Avatar for Smoking Bros

Your porblem was : [code] Shapes::Shapes(char shape, int x, int y, int width, int height); <--THIS SEMICOLON { cout << "You created a: " << shape " shape. At X: " << x " At Y: " << y " Width: " << width " Height: " << height << …

Member Avatar for mrnutty
0
508
Member Avatar for sara9111

"What the diffrent bettween while looping, conter-controlled while loop, sentinel-controlled while loop,flag-controlled while loop, do while loop and For loop. " Their syntax and spelling:)

Member Avatar for mrnutty
0
132
Member Avatar for ArvindRaja

short answer : change [code] void printtext(char **lotsoftext,int m,int n) [/code] to [code] void printtext(const char **lotsoftext,int m,int n) [/code] Just a side note, when your function does not change the content of its arguments thats passed, then make them const.

Member Avatar for mrnutty
0
88
Member Avatar for SeeTheLite

Yes, and if your compiler does not support the keyword export, then it has to be in the same file. (note not tested) For example : [code] //pair.h #ifndef PAIR_H_ #define PAIR_H template<typename Type, template Type2> class Pair { private: Type first; Type second; public: Pair() : first(0), second(0) { …

Member Avatar for SeeTheLite
0
97
Member Avatar for hardikvd

Its simple as this [code] float a = 3.1234567; float b = int (a * 1000 ) / 1000.0f // now b = 3.123 [/code]

Member Avatar for mrnutty
0
89
Member Avatar for xfreebornx

Lets see what you are doing : [code] #include <iostream> #include <cmath> using namespace std; int main() { int a, result, factorial(a); //declare 'a' as an int //declare 'result 'as an int //declare 'factorial' as in int, initialized to //the value of 'a' which is ? junk... { cout << …

Member Avatar for mrnutty
0
115
Member Avatar for ryancfc

"I just want to have random numbers which are unique." So whats the problem. Are you stuck somewhere, trying to implement this? How about a trial and show us where/if you have problems. Since its only 5 numbers, you can create an array that holds say 5 elements. Then fill …

Member Avatar for ryancfc
0
174
Member Avatar for SeeTheLite

What you are doing is very dangerous! [code] bool *dat; //create a bool pointer dat=new bool; //set bool pointing to a address, i.e pointer-to-bool dat=true; //give value to the pointed address ++dat; //increase the address of bool. Huh-oh, but where is the //next address. Even worse, what does that address …

Member Avatar for kvprajapati
0
97
Member Avatar for cokaznsyco72

Now try a recursion functions for this job. 1) Find a base case. 2) Find a pattern. 3) Recurse pattern until base case is reached. Also no need to worry about the little details right now. Just keep it in mind.

Member Avatar for cokaznsyco72
0
185
Member Avatar for TheSilverFox
Member Avatar for TheSilverFox
0
106
Member Avatar for vedybird

when your display value reaches 60, you add 1 to minutes, and keep doing this until your minutes adds to 1 hour; Try this circular loop : [code] displayValue = ++displayValue % 60; min = displayValue % 60 + displayValue/60 hour = min % 60 + min/60 [/code]

Member Avatar for mrnutty
0
130
Member Avatar for madmath

Here is one way of doing it. [code] int Array[5] = {0}; int num(0); //the number the use will input; for(int i = 0; i < 5; i++) { cout<<"Enter value# "<<i<<": "; cin >> num; if( num >=5 && num <= 15) //put number into array only if its …

Member Avatar for mrnutty
0
3K
Member Avatar for kylelyk

Yes its normal. The first window is from your compiler, and the second is where you render you objects. It will be useful when you need to debug you application.

Member Avatar for mrnutty
0
112
Member Avatar for qkslvr1621

common mistake : [code] while (qAnswer = 'y'); [/code] should be [code] while (qAnswer == 'y'); [/code] You understand the difference between '=' and '==' right?

Member Avatar for mrnutty
0
113
Member Avatar for bharatsinh

Could you give us more information , so we can answer your question better. Not that most will hand you the answer without seeing you suffer:)

Member Avatar for mrnutty
0
144
Member Avatar for valmiki

You might want to try a more general approach, where the user gets to input the number of rows for the tree.

Member Avatar for mrnutty
0
94
Member Avatar for lotrsimp12345
Member Avatar for mrnutty

I tried to install the devil library but I am getting some errors. Here are the steps that I am taking to install it : [code] Let me see if I did this correctly : Steps : 1) download DevIL 1.7.8 for windows 32 bit 2) extract the info to …

Member Avatar for AlbertPi
0
402
Member Avatar for ss2602

use ifstream then : [code] int main() { cout<<"Enter file name (with extension): " char filename[1024] = {0}; cin >> filename; ifstream iFile(filename); ...//do some stuff } [/code]

Member Avatar for tux4life
0
107
Member Avatar for sravanitalari

just to help start you off (from how I interpret the problem ): Steps : 1) declare variable for input 2) get user's input via cin 3) have a class ready to pass the variable to its consturctor 4) inside constructor decide which class the students get 5) print the …

Member Avatar for mrnutty
0
72
Member Avatar for mrnutty

I am using c++/opengl. Can someone help me with a wrapper for a 2d ball representation. I have one but its not complete. I need other stuff like momentum and collision response. Can you help me implement this?

Member Avatar for MattEvans
0
139
Member Avatar for mrnutty

How could one share a .exe that loads textures. I am using c++ and openGL. I want to share the .exe that I made using rapidshare.

Member Avatar for tux4life
0
84
Member Avatar for mrnutty
Member Avatar for mrnutty

I know that it returns the remainder but what happens when say : x% y, where x,y is int and x<y. I see that results in x; For example, 3% 101232 = 3 and similarly 3%y, where y is greater than 3 yields 3. Why is that> Just wonder the …

Member Avatar for chaines51
0
283
Member Avatar for cruisx

What you want to achieve will take a lot code than what you might expect. I would recommend to use '*' as un-fliped mode so the user wont get confused.

Member Avatar for mrnutty
0
180
Member Avatar for mrnutty

I just started a few days ago. I am troubled with the input in c#, even though I got it to work. Any comment would be helpful. Its a Number Guessing game and a tic-tac-toe game. [code] using System; namespace GAME { #region NUMBER GUESSING GAME public class Number_Guess { …

Member Avatar for skatamatic
0
399
Member Avatar for mrnutty

I am trying to rotate the object by a input of key. I dont know why the object is not rotating. I used glRotatef(x,0,0,1); //where x is declared as float : here is my code : [code] #include<GL/glut.h> GLfloat x = 10; void initGL() { glEnable(GL_DEPTH); glDepthFunc(GL_LEQUAL); glClearDepth(1.0f); } void …

Member Avatar for MattEvans
0
118
Member Avatar for mumneedshelp

Know : C/C++ Python java OpenGL DirectX Depending on you situation, your son should learn the list above , although c++ and opengl/directx should be more important than others. Also check out community colleges, and talk to them for what courses they offers, with regards to programming. Or even check …

Member Avatar for Ancient Dragon
-1
529
Member Avatar for aburich_44

try to zip it up. If you have visual studio 8. Then build your code. Then open my computer. Go to C: , then find visual studi 2008. Then find you project name. Then search the folder for .exe file. Clik on it to make sure it works. Then right …

Member Avatar for mrnutty
0
167
Member Avatar for mrnutty

how would you seperate a character in a string. For example : string ="2x^2+8" how would i seperate the string into '2' 'x' '^' '2' '8'. so I could find its derivative.

Member Avatar for Comatose
0
105
Member Avatar for CPPRULZ

example of cin.get(). say a file called num.txt contains the following : 12345677700234. using cin.get() would first get the number 1, then it may be easier to imagine an arrow pointing to the number 2 , because the number 1 has already been extracted. Then using cin.get() again would ger …

Member Avatar for mrnutty
0
115
Member Avatar for mrnutty

hi, I am confused on why my texture came out a different color? I have a bmp file of a cloud, skyblue color on the background and white clouds. BUt when i load it on a square the color becomes pinkish for background and cloud is white? Why pink-ish? here …

0
54
Member Avatar for mrnutty

hi, I am trying to draw a circle without using cos,sin; Mainly by the formula x^2+y^2 = r^2; this is my code , but for some reason its not working. any help? note: I thought this code would draw the upper halve fo the portion. float xCor,yCor; xCor=yCor =0.0; float …

Member Avatar for MattEvans
0
154
Member Avatar for mrnutty

hey, I am just learning textures in OpenGl, from a certain tutorial site : [URL="http://www.spacesimulator.net/tut3_texturemapping.html"]http://www.spacesimulator.net/tut3_texturemapping.html[/URL] the site had a good tutorial for texture, but after loading the .bmp picture, it goes to create its own function for vertex3f and such ( I think). In any matter, I have not learned …

Member Avatar for mrnutty
0
292
Member Avatar for mrnutty

i am writing a code that will rotate the polygon but it seem as if it is not working any help? [code] #include<iostream> #include<Gl/glut.h> #include<cstdlib> using namespace std; GLfloat fPent = 0.0; // for rotating pentagon; GLfloat fSqr = 0.0; // for rotating square; void handleKeyPress(unsigned char key, int x, …

Member Avatar for sciwizeh
0
130
Member Avatar for mrnutty

I am practicing lighting and smooth shading. THe problem is that this code only shines the light for front and the right side , but when the objected is rotated, it shines at constant position (the front and right) and not to the side that are on the positioned light. …

Member Avatar for MattEvans
0
108
Member Avatar for it2051229

You should look at the unit circle. So obj 1 has a velocity of 0 in direction 3pi/4(south) and you want it to face northeast towards the obj 2. so you need to rotate obj one anti clockwise on the angle pi/4. this is a hint try to figure it …

Member Avatar for Alibeg
0
143
Member Avatar for learning_prog

first off iostream.h is not standard so dont bother using it. use #include<iostream> instead. to solve your problem try doing this : [code=cplusplus] #include<iostream> using namespace std; //important. int main(){ cout<<"Hello world."<<endl; return 0; } [/code]

Member Avatar for John A
0
129
Member Avatar for mrnutty

hi, I started learning openGl yesterday. I made a simple program that supposed to create a triangle and a square, but its not working properly, any help please? [code] #include<iostream> #include<Gl/glut.h> #include<cstdlib> using namespace std; void handleKeyPress(unsigned char key, int x, int y) { if(key == 26) exit(1); } int …

Member Avatar for mrnutty
0
118
Member Avatar for ~gamer4life~

First of, You should get very familar with C++( if you don't know it already). Then after you are comfortable with C++. Then you will know how to make text based game. note: atleast learn up to classes in C++. Then go to youtube or google text game in C++. …

Member Avatar for mrnutty
0
80
Member Avatar for mrnutty

What is the first term in the Fibonacci sequence to contain 1000 digits? so i made a program that finds the fibonocci's sequence (fs). I tried to do it recursively but it takes too long for big numbers. so i made a manual one. BUt as i count how many …

Member Avatar for aryansmit3754
0
141
Member Avatar for mrnutty

I am just curious, just how much of math do one really needs in order to make, say space invaderes, or pacman....WOW,..NBA LIVE 2009? It's not that i am bad at math or anything, in fact I am pretty good at it and still learning, calc.II. BUt i am curious, …

Member Avatar for mrnutty
0
143
Member Avatar for idb_study

your problem is your cout statement. instead of cout<<mat[l]; it should be cout<<mat[l][k];

Member Avatar for idb_study
0
102
Member Avatar for mrnutty

#include<iostream> #include<fstream> #include<cmath> #include<iomanip> using namespace std; /* 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000? */ //my logic is to export 2^1000 into a text …

Member Avatar for Rashakil Fol
0
141
Member Avatar for mrnutty

hi, I am curious, how can I read a int from a text file( ex. num.txt). but this text file contains numbers without spacing (ex.1212132132313... 23156897984969.. 583852935792...) The problem is that this file has no spaces between numbers and when i try to read it into an arry, the result …

Member Avatar for VernonDozier
0
151
Member Avatar for mrnutty

how would I check how long a program takes for it to be completed. (i.e the time it takes for the program to be finished doing its calculation)) Thanks

Member Avatar for stonerain
0
111
Member Avatar for mrnutty

[code]#include<iostream> #include<fstream> #include<cmath> #include<iomanip> using namespace std; unsigned __int64 Fact(unsigned __int64 x ); int main(){ /*n! means n (n 1) ... 3 2 1 Find the sum of the digits in the number 100!*/ cout<<Fact(100); } unsigned __int64 Fact(unsigned __int64 x ) { __int64 num(0); if(x==0) return 1; else { …

Member Avatar for grumpier
0
117

The End.