C++ :: Converting Text To Hex
Jan 3, 2013
From my tests I found the problem to be somewhere in the Mantissa part that converts it to binary.
bool xsDLL GetHexFromSF_IEEE754( void* to, Text from, ui08 tSize ) {
from.UpperCase();
int db = 0, dB = 0, dBEnd = tSize, dBLast = ( tSize - 1u ), dbEnd = dBEnd * 8;
ui08 *data = reinterpret_cast< ui08* >( to );
for ( ; dB >= 0; --dB )
data[ dB ] = 0u;
[Code] ....
Adjustments made, still having problems though. After finding a more useful resource [URL] ..... I got the function looking more like it should but am still having problems...
View 1 Replies
ADVERTISEMENT
Jul 25, 2012
Take a number that is entered by a user and turn that into printed text. Ex. 85 would be eight five. The problem I am having is I'm not quite sure how to go about this. I don't know if I should use an array, string, or something else.
View 12 Replies
View Related
Jul 16, 2014
I'm trying to create a sort of text-adventure game, but rather than having to check for the input being uppercase or lowercase, I'd rather convert it before checking it in an if statement.
I've created a function, and I know it works because when I print the output, it shows up capitalized, however when I check it with an if statement, it doesn't pass.
Here is my code:
#include <iostream>
using namespace std;
void stringUppercase(string x) {
int i;
for (i = 0; i < x.length(); i++) {
[Code] ....
View 4 Replies
View Related
Feb 3, 2015
know of a handy function (or library) for converting between different text formats? I've heard of a library called iconv but I've no familiarity with it. However, it looks promising (from what little I can find out about it...)
Specifically, the text %20 is often used in hypertext to indicate a space character - so the string "Hello There" would get changed into "Hello%20There". How can I easily change between one and the other?
Obviously I could use string replacement functions but that'd need me to anticipate every potential hypertext code sequence.
View 5 Replies
View Related
Jun 5, 2014
I want to make a program that opens a text file and checks the usernames listed in the text files to see if the names are registered on a site such as twitter. How easy would this be to make, what things would I need to know?
View 4 Replies
View Related
May 31, 2013
I am trying to get text file and read only first 100 lines of the text content using c/c++. how can i do it?
is it something like string line;
getline(stream,line);
??
View 7 Replies
View Related
Aug 30, 2013
I have a huge text file in following format:
{Bunch of text
.
.
}
[Code].....
I want to extract Text1, Text2, Text3, Text4,..., Text600 in the output file. How can i achieve this?
/* BTW, I am not getting my homework done here. I am an ex-programmer, who has now moved to marketing for some time now, and today, I encountered this problem, which I believe can be solved easily through programming. */
View 3 Replies
View Related
Aug 31, 2014
i want to create 100 gmail accounts instantaneously....what i want from you guys is i have written a program that create a text file i want that once i give the program the imput of 1 it should delete the first 3 lines from the file i.e. the first account details coz that is already been created and shift the rest of it 3 lines upwards after that i'll write a javascript that will automatically fill and create the accounts with those names in web browser.....my lil program is here:
#include <stdio.h>
#include <conio.h>
main()
[Code]....
View 1 Replies
View Related
Mar 26, 2013
Program that reads in a normal text file and converts it into mobile phone text. that is if the word is 3 characters or less then ther is no changes to the word and if the word is four or more letters then remove all the vowels from the word except for vowels that are capitals.
View 5 Replies
View Related
Aug 2, 2014
I have a text file called (Test.txt) with the following text:
This is line one
This is line two
This is line three
How do I go about writing a program that will print a line of text (e.g. "This in line two" on the console screen?
All I can seem to do is display the entire text file.
View 6 Replies
View Related
Aug 23, 2012
I want to highlight selected text in a wpf textbox while the textbox is not focused. In my application, my textbox never gets focus, and every key input is done manually. I was wondering if there is a way to highlight the selected text when the textbox is not focused?
View 1 Replies
View Related
Feb 20, 2014
Why is this
Code: fFile << (char) (i)p.x, (char) (i)p.y,(char) (i)p.z); not the same as this
Code: printf("%c%c%c", (i)p.x, (i)p.y, (i)p.z);
View 13 Replies
View Related
Apr 7, 2013
I am in a c++ class and my group is having a hard time making this work... It keeps saying that 'fileOne.open' isn't working.
#include <iostream>
#include <string>
#include <fstream>
[Code]....
View 3 Replies
View Related
Nov 8, 2014
Having trouble converting char to hex.
according to here [URL] ....
ô in decimal is 147 and print ô using alt 147
and here [URL] ....
ô in dec is 244 but prints ⌠ using alt 244
put on console
char c = ô;
cout << (int)c << endl;
prints -109 and print m using alt -109
I am using alt to test char output. Why I'm getting a negative value? Which of the tables are correct? I have string of char that I want to print in hex. I get a hex string but the hex value don't correspond to any of the two tables on the websites because the console converts special char to negative values.
View 2 Replies
View Related
May 16, 2013
I am having problems with converting a CString to an int and than doing checks on the int to see if it is in a particualr range.Below is what I am doing.
CString numstr = "28"
int num = atoi(numstr);
BOOL valid = TRUE;
if(num < -32,768 {
valid = FALSE;
}
For some reason when running the above code the if statement is executed but it should not be becasue 28 is not less than -32,768. Why this is happening, I am not seeing the reason for this at all!! The num variable is being assigned the correct value.
View 5 Replies
View Related
Jun 8, 2014
I am having trouble converting strings in my application.
This is the code that is eventually getting called, the first parameter takes a LPCWSTR
Code:
hr = m_pGraph->RenderFile(m_filePath, NULL); // takes LPCWSTR This is where the trouble begins.
The compiler shows that sResult is proper but after I try to convert a std::string to a wchar it prints garbage
Code: const wchar_t* m_filePath = (wchar_t *) oDb->GetNext().c_str();
Code:
std::string CSqlLiteDatabase::GetNext() {
sqlite3_stmt *oStmt = nullptr;
std::string sql = "SELECT path || filename FROM table WHERE id = 1";
char message[255];
[Code] ....
View 6 Replies
View Related
May 18, 2014
Code:
void convertNetPay(float netPay, char *netPayString){
int numHuns, numTens, numOnes;
char OnesTable[9][8]={"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
char ResultString[10+1];
char TensTable[9][8] = {"Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"};
char TeensTable[9][10] {"Eleven","Twelve","Thirteen","fourteen","fifteen","Sixteen","Seventeen","Eighteen","Nineteen"};
float cents;
[Code] ....
I have to convert my netpay which is a float to a string So if I input a value of say, 356.26 it should output "the sum of three hundred fifty-six and 26/100 dollars" . My program function works for the sum of three hundred but after that it spits out garbage.
View 2 Replies
View Related
Jun 3, 2014
i m trying to write a code that would convert a each letter from a text to their decimal images . while i was able to write the part of entering the text , i cant do the converting part , i searched all day on the internet and found nothing.
View 3 Replies
View Related
Oct 31, 2013
Write a program to convert the time from 24-hour notation and vice versa. Your program must be menu driven, giving the user the choice of converting the time between the two notations. Furthermore your program must contain at least the following function : a function to convert the time from 24-hour notation to 12-h notation, a function to convert the time from 12-hour notation to 24-hour notation, a function to display the choices, function(s) to get the input, and function(s) to display the results.
View 2 Replies
View Related
Mar 13, 2014
I am trying to read into a file that has something like
I have 5 apples and 9 bananas.
Sam has 8 apples and 6 bananas.
and I need to replace the numbers with words. For example I need to change the "5" to five and so on. The problem is that im not sure how to access and then replace just the numbers.
#include <iostream>
#include <cmath>
#include <fstream>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main() {
ifstream in_stream;
[Code] ....
View 2 Replies
View Related
May 6, 2014
How will I add the existing content of the text file to the newly inputed date(hoursworked & minsWorked) to compute the total number of hours works. I'm just a beginner in using Visual basic C++.
Code:
#include <iostream>
#include <fstream>
#include<string>
#include <cstdlib>
using namespace std;
bool parseTime(char* _timeStr, int& _hour, int& _min) {
[Code] ....
View 6 Replies
View Related
Dec 7, 2014
I'm trying to find a way to accuratley convert a double in the form of a bank account number stored in a file into a string representing the number returned by a file.
View 1 Replies
View Related
May 18, 2014
void convertNetPay(float netPay, char *netPayString) {
int numHuns, numTens, numOnes;
char OnesTable[9][8]={"One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
char ResultString[10+1];
[Code] ....
BASICALLY, I have to convert netpay (float to string). Theoretically if I have 666.66, my program here should output the sum of "six hundred sixty-six and 66/100 dollars".
View 4 Replies
View Related
May 2, 2013
i think i need to convert a double to a string, we are working in visual studio doing a program. when i run the calculator i'm not getting the answer i need instead its giving me 0.0 when it should be reading 0.5, here is the code i'm using
{int width;
int height;
int area;
double gop;
String ^strWidth;
String ^strHeight;
String ^strArea;
String ^strGop;
strWidth=width1->Text;
[Code]....
View 1 Replies
View Related
Jun 22, 2014
Sandy is of class Person, who converts to Muslim and takes on a new name Fatima, and has all the attributes of Sandy, with new Muslim attributes (e.g. religion == Islam, etc..). At this point, Sandy can be deleted, and Fatima, now of class Muslim will play Sandy's role henceforth. The problem is that due to her new address, all the people who knew Sandy does not know Fatima. Manually changing Sandy's address to Fatima's address for all those people who knew Sandy is clearly not an acceptable method. I looked through all the design patterns and cannot find one to solve this problem. how to improve the design? Here's my simplified code showing the problem:
#include <iostream>
#include <string>
#include <typeinfo>
class Person {
std::string name;
Person* bestFriend;
[Code]...
Output:
sandy = 0x32658, 6Person
Mary's best friend is Sandy.
fatima = 0x23fec0, 6Muslim
Mary's best friend is Sandy.
Of course, we want to have: Mary's best friend is Fatima,. with mary->getBestFriend()->getReligion() == Islam, etc... How to redesign the whole thing so that this is automated (assume there are thousands of people who know her)?
View 14 Replies
View Related
Aug 20, 2014
I want to convert the matrix to vector and vice verse.
View 1 Replies
View Related