In other words transferring the value from Edit1->Text to CpinEdit1->Value;
Integers won't work because the number is to big. So i tried going from String to Number like in this article Converting numbers to strings and string - C++ Articles
But that won't work because its an Ansistring, how would i go about this conversion?
I am using borland turbo c++ version 4.5 and for printing a coloured output i used textcolor() but it is showing error that call the undefined function 'textcolor' in main, so what can i do now to print a coloured output???
I would need to know how to make the c++ builder application to be started with administrator rights (it's common behaviour for installers - when it is started, it asks for administrator rights).
So, I'm supposed to do : Create a function with unlimited number of arguments, which forms a dynamic string based on the following form (%d, %s, %f, %lf, %c), with the following prototype:
char*create(char*form, ...);
The function is supposed to have the following output:
create("Peter is %d years old and is in %s-%c class.",7,"second",'A'); -> Peter is 7 years old and is in 7-A class. create("His GPA is %lf.",4.96); -> His GPA is 4.96. create("His favourite subject is math!"); -> His favourite subject is math!
The part with %d and %s string was not that hard, but now I'm supposed to convert %f and %lf to string, I've tried using sprintf but I've had no luck so far, another problem is the fact that I've gotta use lists to complete the task. I've been trying to convert float to string for the past 2 hours, but I'm drawing a blank now.
I am looking for a math/big num library, that allows me to convert 32/64/80 bot float numbers to string and vice versa.
Precision & accuracy is of importance here, and since this is an IEEE standard, i have high hopes that there are libraries for this out there, which would save me the hassle of trying to implement this myself...
I am having trouble in creating a program (named "up.c") that should do the following:
- if you run the command ("up") with no arguments, it should read input from stdin and display it on stdout, converting lowercase letters to uppercase.
- if you run the command with one or more files (as arguments to the "up" command), your program should read input from each file and display it on stdout, again converting lowercase letters to uppercase.
I'm trying to create a single program that can do both of these, and handle errors gracefully. I've found that some codes work to convert the letters, but they seem overly simple and aren't giving me what I'm looking for in my program.
I have a question on conversion between char & string. I have cut & pasted the part of the code from my C++ code and my function "decryptPwd" uses C style code with "char" etc.
I need to pass a string (mypwd) somehow to this function after conversion & then compare it to another string (newmypwd).
I tried - "decryptPwd(mypwd.c_str())==newmypwd.c_str()" but it did not work.
.. #include <string> .. char* decryptPwd(char hash[64]); main () { string mypwd; string newmypwd; if (decryptPwd(mypwd)==newmypwd)
I'm trying to make OBJ converter. The file structure of which I am trying to convert is an XML structure. Here's an example. I currently have a lua script that does this for me. But it always crashes on big objects. It's for a game called "ROBLOX" The only information I need to convert is.
<int name="BrickColor">194</int> <-- Brick Color <CoordinateFrame name="CFrame"> <-- Position <X>0</X> <Y>0.600000024</Y> <Z>0</Z>
And
Vector3 name="size"> <-- Part size. X>1000</X> Y>1.20000005</Y> Z>1000</Z>
Here's the lua script. [URL] .....
This currently grabs all of the ClassNames in the place and converts them to OBJ wavefront gemotry.
So I tried debugging this program almost 10 times, each time finding a problem then making code to fix it, I used to get wrong values but then now after I changed the calculation from an infinity while loop to a for loop (because after some changes I realized that now I know the number of entries, meaning the start and the end of the loop) the program now displays no values at all. I checked it thoroughly and until the calculation process its functioning exactly the way it should but then the calculation breaks hell loose . Also the for loop that raises 2 to the power needed works fine too so it must be something with the other processes included in the calculation....
This used to be a function of a multiple value types conversion program, I isolated it for easier analysis as a lone standing program.
Code: #include<iostream> using namespace std; int main() { int d[10],e[10],anse=1,r,limit; short int counterd=0,i,j; float bind=0;
I am Getting following errors I don't know why.I have mentioned the lines (in comments) where these errors are occurring. __________________________________________________ warning C4018: '<' : signed/unsigned mismatch error C2064: term does not evaluate to a function taking 0 arguments error C2064: term does not evaluate to a function taking 0 arguments __________________________________________________ _
Code: /*Currency Conv Control Module*/ #include <stdio.h> #include "currencyconv.h" /* defines constants, declares functions */ int main(void) {
float us_dollars; float currency; int user_input;
[Code] ....
This is $$ converter program I created that is split up over 3 files. It takes the users input in US Dollars and converts it to the currency selected. When executing the program I am encountering a small problem. It actually isn't converting anything and returns 0.00 dollars.
I would like for it to convert the amount entered into the currency selected. I would also like to add in the print statement the type of currency the user has selected.
Code: #include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> #define MAX 50
[Code] ....
[URL] .....
My output should look like this ..
Enter an expression in infix form: (9+6)/(2*4)^15
Specify output expression type,1) Prefix 2)Postfix The Prefix expression is: /+96^*2415 ---------------------------------------------- Enter an expression in infix form: (9+6)/(2*4)^15
Specify output expression type,1) Prefix 2)Postfix The Postfix expression is:96+24*15^/
i have given a project for currency conversion program with add,delete,search,display option. but i was thinking if it can update the currency rate from internet at beginning.
I want a code that can convert floating/double value into string/char array(char arr[]) and also it can be run on Boreland C++ 5.02
Here I've a code but it doesn't show all the numbers. Instead, it's showing in exponential form which I don't want!!
int main() { char* str = new char[30]; float flt = 2.4567F; sprintf(str, "%.4g", flt ); cout<<str<<endl; //Exponential form even after 6 digits without decimal return 0; }
what I want to say is, there can be several conditions for adding a signed int to an unsigned long:
1: if the ival is positive, then adding a positive to a positive, both value should be converted to unsigned long, which is reasonable, even when the sum is larger than the max limit of unsigned long, because user himself should be ware of that the sum value may be too large and will be modulo into the range of unsigned long.
2: if the ival is negative, but the sum is positive, then both sum and ulval can fit in unsigned long, so we should convert them into unsigned long
3: if the ival is negative, and the sum is also negative, that means the ulval's real value can actually fit in int range, so the compiler should convert it to int, so as to preserve the value. but compiler didn;t do this to comply it's "preserving value" rule.
This program is basically working. I'm very knew to C++, so basically I need instructions as if you were explaining this to your grandma. I need this to loop but how to incorporate one. Basic code (while loops). Here is what I've done so far.
#include <iostream> using namespace std; int main () { int i, c, k; cout << "Please enter a number to convert: "; cin >> i;