48,985 Topics

Member Avatar for
Member Avatar for d883956

Im tryna get my code (as seen bellow) to print both the variable "jax" with two decimal places, and the full value opf the variable "jax" so the out put should be: [B]8712.65 8712.654[/B] [b]How do i do this? [/b] [code]#include <iostream> #include <iomanip> using namespace std; int main() { …

Member Avatar for Narue
0
121
Member Avatar for Lukezzz

Hello, I am opening a new Form in my application and want to pass along a variable to Form2. I think I am pass along it correctly but are not sure how to receive it in Form2. How will that be possible ? [code] String^ ForwardVariable; private: System::Void button1_Click(System::Object^ sender, …

Member Avatar for Lukezzz
0
171
Member Avatar for wittykitty

I have been trying to figure out for the life of me what I am doing wrong here, and I am coming up blank. My operator is returning the correct value in temp - as you can see highlighted in red, however, when I use the operator in main - …

Member Avatar for wittykitty
0
114
Member Avatar for CodyOebel

So far no one has been able to tell me why this code is not working, or what I need to do to THIS code to make it work. Can someone simply show using MY code below where the problem is, and why it's not working properly? Problem: I am …

Member Avatar for n.cramp
0
2K
Member Avatar for roin14

using switch and if ... else statements, write the two grading programs. consider the following grading system; 70-100 A 60-69 B 50-59 C 40-49 D 0-39 F

Member Avatar for Robert1995
0
112
Member Avatar for johndoe444

In the following code: [CODE]#include <iostream.h> class Base { public: Base(){ cout<<"Constructor: Base"<<endl;} ~Base(){ cout<<"Destructor : Base"<<endl;} }; class Derived: public Base { //Doing a lot of jobs by extending the functionality public: Derived(){ cout<<"Constructor: Derived"<<endl;} ~Derived(){ cout<<"Destructor : Derived"<<endl;} > }; void main() { Base *Var = new Derived(); …

Member Avatar for Narue
0
163
Member Avatar for johndoe444

In some c++ source code I wrote this: [CODE]#include <iostream.h> using namespace std; [/CODE] [CODE]error: iostream.h: No such file or directory[/CODE] I compiled it using g++. But when I changed it to #include <iostream> it started working. Why?

Member Avatar for craig_ka
0
141
Member Avatar for johndoe444

Does endl do the same thing as %n in java and print the platform dependent end of line ('\n', \n\r' or '\r')? If not then is there anything similar in c++.

Member Avatar for Narue
0
72
Member Avatar for theABCasian

hey everyone ok so i have reached another road block any pointers are much appreciated the program will not compile due to eclipse not liking the int Password::passwordNumber(int i); int Password::passwordCapLetter(int i); in the .h any ideas demp.cpp [CODE] /* File Name: Demo.cpp Chapter No. 12 - Exercise No. 12 …

Member Avatar for mitrmkar
0
170
Member Avatar for sejalpastagia

[code] main() { int a; a=message(); } message() { printf("\n C language"); } [/code] //what is the output and what return will return to a";

Member Avatar for Ancient Dragon
-1
105
Member Avatar for Ginkan

Hi all, Im new to this forum and also very new to C++, Im tring to write something with DirectX, but once I use DirectDrawCreateEX(), VC++ give me: --> error C3861: 'DirectDrawCreateEX': identifier not found My environment is Windows 7, VC++ 2008 Express Edition, Installed DirectX SDK FEB 2010, Any …

Member Avatar for kenji
0
81
Member Avatar for natomiast

Hello, I have to do simple program which will be work like Deterministic Finite-state Automaton. DFS will be accept some language describe by regular expression (e.g. (a + b)*). Program will read word from text file and analyse it. If word is acceptable program will give info to user. I …

Member Avatar for donaldw
0
127
Member Avatar for ischuldt

I wrote this distructor one way, but the person who code reviewed it seems to think it's better and more readable the other way. I disagree. It's probably more a matter of preference, but what do you think... [code] RfPrinter::~RfPrinter() { if (!hub_.empty() && !name_.empty()) { clearbuf(rfunitlock); rul_hub = hub_; …

Member Avatar for Fbody
0
133
Member Avatar for allaboutdrew

I am recently new to C++ and I wondered if someone could show me how to modify my program below. I want the program to test if there is more than 1 day that has the highest rainfall and susequently to output those corresponding days. Than you :) [CODE]#include <iostream> …

Member Avatar for gnarlyskim
0
119
Member Avatar for gregarion

Hey guys, i am having a problem solving a this part of my coding. Basically, what im doing is for the program to read a string, and if there is a value of 'M', the value of num will go up by 1000. Here my coding .... [CODE] string msg …

Member Avatar for gregarion
0
156
Member Avatar for metdos

For example, [CODE]MyClass *stable; if(..){ MyClass temp; stable=&temp; } stable.myVariable;[/CODE] Code snippet above does not work, because destructor of temp object is called. How Can I Increase Scope of "temp" object? Thanks.

Member Avatar for mattjbond
0
172
Member Avatar for vbx_wx

hello,i am using GetAsyncKeyState() function for a keylogger,but my problem is: how do i test if 2 keys are pressed simultanion. For example: when i press SHIFT and letter 'a' it should print 'A'. Can anyone help me ? thanx

Member Avatar for Narue
1
140
Member Avatar for gregarion

Hey guys, i been looking through at questions regarding roman numerals and i have a question. i ran some of the coding which i found and i dont quite understand this part.. [CODE] int number = 3000; int number2 , i ; number2 = number / 1000; for(i = 1; …

Member Avatar for metdos
0
102
Member Avatar for 42Wired

I'm trying to open a file (ifstream object), read from the file, then pass the ifstream object to a function where it will continue reading from the file. Along the way, I want to store the path of the file, and would like to know if there is a way …

Member Avatar for 42Wired
0
295
Member Avatar for miskeen

Hello, I have to use an array, but its length is unknown at the beginning of the program. Is it possible to create such array and after that give it the desired length? Thank you!

Member Avatar for miskeen
0
15K
Member Avatar for chidambaram

hi all, I am working a carbon application using c++ in Mac machine. I want to find the ip address of my machine using code. How can i get this ip address? Thanks in advance and urgent plz...

Member Avatar for samar ihab
0
272
Member Avatar for sam1900

hi i want to call some functions from a DLL(which is provided by a hardware manufacturer without the .lib and .def). I've used these following code HINSTANCE hinstLib; MYPROC ProcAdd=NULL; BOOL fFreeResult, fRunTimeLinkSuccess = FALSE; // Get a handle to the DLL module. hinstLib = LoadLibrary(TEXT("C:\My.dll")); // If the handle …

Member Avatar for Banfa
0
159
Member Avatar for wtvrinc

Hello, I am trying to compile this program, however it is giving error Error 2086. Infile Redefinition. Am I allowed to redefine Infile, or I am supposed to use it only once? It might be silly error, Kindly help... Thnaks in advance...[code]#include<fstream.h> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #define pi 3.141593 struct …

Member Avatar for Banfa
0
278
Member Avatar for myluvstefan

Hi, I've spent a lot of time on this program and I'm stuck. My assignment is to prompt for two input strings. Print out each string Concatenate string1 and string2 and store the concatenated string into string3 without changing what's stored in string1 or string2. print out the concatenated string. …

Member Avatar for mattjbond
0
293
Member Avatar for VilePlecenta

I wanted to use a window style that was border-less or had a 1 pixel wide border, but was re-sizable. It was not actually possible so I tried changing the window style with SetWindowLong() then using SetWindowPos() with SWP_FRAMECHANGED and AdjustWindowRect() It allowed me to resize the window but it …

Member Avatar for VilePlecenta
0
180
Member Avatar for LemonLemon

I am using VC++ 2008. I want to rotate the Bitmap in my MFC application. I tried the GetPixel and SetPixel functions, but the performance is too slow. There seems no Bitmap rotation example using MFC class on the internet Can anyone give me some idea? Sample code will be …

Member Avatar for mattjbond
0
130
Member Avatar for theblastedfool

Hey guys, ive been working on this code for the past couple of hours and I am trying to do the following problem. Write a program that reads the le generated by randGen.cpp (in Problem 1) and stores the numbers in an array of type int. You can assume that …

Member Avatar for mattjbond
0
200
Member Avatar for rkp728

I am getting the following error while building the code in VC: error C2143: syntax error : missing ')' before '&' on building the below code: [CODE]typedef unsigned int uint4; void Find(uint4& a, uint4 b, uint4 c); void Find(uint4& a, uint4 b, uint4 c) { . . . . }[/CODE] …

Member Avatar for mattjbond
0
73
Member Avatar for Izzy123

Im having trouble opening the .txt file in dev-c++, I've entered the correct name for the .txt file which is saved under the same folder, but whenever I compile and run, it will just show : " Begin reading file. End reading file. --------Welcome------- Please choose: etc. " The .txt …

Member Avatar for Izzy123
0
145
Member Avatar for CreativeCoding

In visual C#, there was this thing where you can add a settings file and refer to a setting in that settings file in your code. With that, I was able to save user settings easily. But I can't find it in C++. Is there no settings file option? If …

Member Avatar for WaltP
0
131

The End.