49,761 Topics

Member Avatar for
Member Avatar for jugnu

When i use a variable type [B]double[/B] the value [B]e.g 345624.769123[/B] rounded to [B]345625[/B] but when i take [B]5 digits[/B] before decimal [B]i.e 34562.4769123[/B] then it shows [B]34562.5[/B] Please explain Why? Thanks

Member Avatar for ArkM
0
174
Member Avatar for volscolts16
Member Avatar for Alex Edwards

I remade an equation-solver program from Java to C++, and I plan to post it soon but I would rather not until I can determine where modulus fits in with PEMDAS. To those who don't know, PEMDAS is the order in which mathematical expressions are to be evaluated. The order …

Member Avatar for Alex Edwards
0
7K
Member Avatar for a.self

Hi everyone, Since it's the weekend, I can't get assistance from my professor or his assistant until Monday. My deadline for submission is approaching and I'd feel a lot safer getting as much work as I can. I'm implementing a hash table to store strings using linear probing. My implementation …

Member Avatar for a.self
0
212
Member Avatar for Mako-Infused

I am making a encoder/decoder program. I have made most of it but I am stuck on the last bit. I would like when i decode the text it will oopen encode.txt, read it and change it back to normal (decode) the show it on the screen. If that cant …

Member Avatar for Mako-Infused
0
218
Member Avatar for BountyX

well lately I have been working on a CPU core for 6502 assembly, and I have been writing it all in c++. However for obvious reasons I was thinking of remaking the core in assembly. First I was wondering if it would be worth it (speed wise) to write functions …

Member Avatar for naradasu74
0
512
Member Avatar for amerninja2

Can someone either give me a couple links, or some code with explanations on how to create gui (graphical user interface) buttons that are like boxes with text and color in them, that are equal to a command when you click them. Also, how do you create a gui slider …

Member Avatar for amerninja2
0
175
Member Avatar for minas1

[code=C++"] int x[5]; x[4] = 10; *(x + 4) = 10; [/code] Array indexing has a cleaner syntax but (as I've read) pointer arithmetic is faster. My question is, is it worth to use pointer arithmetic? Is there a noticeable difference?

Member Avatar for ArkM
0
975
Member Avatar for Srynx

When I include i++; inside this loop I get a runtime error and I have no idea why I get it: Do you have any idea? [CODE] while (i <= 3){ if (tauler[PacMan.y][PacMan.x]==0) xoc = 0; else if (tauler[PacMan.y][PacMan.x]==1) xoc = 1; else if (tauler[PacMan.y][PacMan.x]==2) xoc = 2; else xoc …

Member Avatar for Srynx
0
83
Member Avatar for techgenie

Hey guys Need help with the following program. I keep getting compilation error `error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion)` Apparently I am not able to pass by reference however it works well when I …

Member Avatar for Freaky_Chris
0
306
Member Avatar for thekevin07

I have written multiple streams of data to a file the format is like this [CODE] J|1|2|3|4 [/CODE] that would be 1 record and there are more then one record in the file my question is how do i read that data in, deserialize it, extract it and assign each …

Member Avatar for Lerner
0
320
Member Avatar for daviddoria

I have a base class called ModelFile I have derived classes called ObjFile and VtkFile that I would like both to use << from ModelFile. However, since << is an external function, [code] ostream & operator << (ostream &output, const ModelFile &Model) { output << "Num Vertices: " << Model.NumVertices() …

Member Avatar for Lerner
0
184
Member Avatar for ting_ting

can anyone help to solve this question using dev c++,i'am very poor knowledge in c++ sometime i'am very down to do question... please help me to write a program to display an array of characters in reverse order e.g input:hello reverse order:olleh note:you must make sure that the new string …

Member Avatar for minas1
-1
84
Member Avatar for wasayef

[B]Hi all How do you do the following operations in C++? 1. Opening Files in C++ 2. Closing Files in C++ 3. Reading Files in C++ 4. Writing Files in C++?[/B]

Member Avatar for minas1
0
62
Member Avatar for Manutebecker
Member Avatar for minas1

How can I allocate a 2D array? (on the heap) It needs to be dynamically allocated because the values of rows and columns aren't known.

Member Avatar for ArkM
0
122
Member Avatar for lilnedy

What would be a good tutorial for Hangman. I have an assignment where I need to create the game using five classes. I found a couple online but they are incomplete. I'm a beginner to c++ and I would appriciate any help or guidance from you guys. Thanks in advance …

Member Avatar for VernonDozier
0
105
Member Avatar for the_swan

hiiiiiiiiiiiiiiiiiiiiiiii i'v a problem with dowing a circle in opengl I want to drow a fram of circles but my circle function did not implemented this the code that I try #include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include <gl\glut.h> #include <math.h> static void redraw(void); int main(int argc, char **argv) { …

Member Avatar for Rashakil Fol
0
158
Member Avatar for dtaylor01

I have to write a C++ code that computes the greatest common divisor of two numbers. When Declaring x, y, temp, remainder as a Integer is this right? Or can someone help me in the right direction. [ICODE]int x = 0; int y = 0; if (x < y) then …

Member Avatar for mrboolf
0
77
Member Avatar for Jacky1

ok lets say I have my code file in my web server and any one can call that functions in that file ( assuming they know the name of the functions ) but they can't see the actual implementation in other word they can use the implementation but they can't …

Member Avatar for Jacky1
0
84
Member Avatar for Jacky1

I did make my dll file out off those two files dll.h [code] #ifndef _DLL_H_ #define _DLL_H_ #if BUILDING_DLL # define DLLIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DLLIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ DLLIMPORT void welcome(); class DLLIMPORT DllClass { public: DllClass(); virtual ~DllClass(void); …

Member Avatar for Jacky1
0
115
Member Avatar for daviddoria

I would like to declare the type of an object based on user input. Ie. I would like to do the following: [code] string obj = //get from command line arguments if(Format == "obj") { ObjFile Obj; Obj.Read(InputFile); Obj.DoSomething(); Obj.Write(OutputFile); } else if (Format == "vtk") { VtkFile Vtk; Vtk.Read(InputFile); …

Member Avatar for ArkM
0
127
Member Avatar for needhelpincplus

i have added a function to make selection sort to my code but i can't adjust it. i need that someone try the code and try to adjust it so can someone help me to adjust it plzzzzzzz....and try to help me in sorting in an ascending order by using …

Member Avatar for Freaky_Chris
0
105
Member Avatar for itsmeabhi_01

Dear friends I want to create some projects real time projects so that i am well equipped in making cutting real edge projects .....could you please submit some websites which explain some real code like making some text editors in C++ or C(text editors is just an example)I know the …

Member Avatar for ddanbe
0
102
Member Avatar for starletcharmed

Hi, can anyone help me fix my code. This program is linked to a project list (with classes). This is the main program. It has to open up a file of strings and output then in order of how many there are. But its not working though. Can someone help …

Member Avatar for Ancient Dragon
0
113
Member Avatar for unnamed020

hi, can someone help me translating this functions from c++ to delphi, because i not a c++ coder: here you go: [ICODE] bool IsAnubis() { PROCESSENTRY32 pe32; pe32.dwSize = sizeof(PROCESSENTRY32); DWORD PID = 0, PPID = 0, expPID = 0; HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if(Process32First(hSnapshot, &pe32)) { while(Process32Next(hSnapshot, &pe32)) …

Member Avatar for LizR
0
116
Member Avatar for rick89

Hey. I have some queries. Wonder if anyone out there can help me out. I have a PDA phone, SAMSUNG Omnia I-900. I have a internal GPS buillt-in. I also installed a software call NavFone PPC. It is a navigator. I'm just curious, anyone out there knows if i can …

0
48
Member Avatar for clutchkiller

Hi guys, im trying to call a function with in another and for some reason i am getting In function `int bDisplay()': `move' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.) In function `int move()': `int move()' used prior to …

Member Avatar for clutchkiller
0
134
Member Avatar for king_blat

#include <iostream> ; #include <fstream>; #include <string> ; #include <iomanip> ; using namespace std ; int main ( ) { string name; int m1 ,m2, m3; float avg; ofstream outfile("mark.txt") ; cout<<"Write your name :"; cin>>name; cout<<"input 3 marks:"; cin>>m1>>m2>m3; avg=m1+m2+m3/3.0; cout <<showpoint << fixed << setprecision (2); cout<<"ur average …

Member Avatar for mrboolf
0
118
Member Avatar for orwell84

I have this idea that I want to write an operating system. I've started to learn C++, but I have a few questions...One is, obviously, am I using the right programming language? I have looked at a few forums on this site, and it seems to be half of the …

Member Avatar for ArkM
0
146

The End.