49,761 Topics
| |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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? | |
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 … | |
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 … | |
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 … | |
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() … | |
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 … | |
[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] | |
Topic... just wondering if it would be friend or pointers in the main or something else... | |
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. | |
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 … | |
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) { … | |
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 … | |
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 … | |
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); … | |
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); … | |
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 … | |
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 … | |
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 … | |
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)) … | |
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 … | |
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 … | |
#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 … | |
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 … |
The End.