This snippet defines a function returning new identifiers created from reading the computer's time.

Member Avatar
Member Avatar
+0 forum 5

This will take a value in EAX or AX, convert to ASCII hex with optional padding and upper or lower case This example would yield "---fc103a" push word 0x222d ; 32 bit conversion, padd output with '-' push word ASCPntr ; Pointer to end of conversion buffer push 0xfc103a call I2H inc ax ; AX points to actual first character AX pointing to 1 character before actual beginning allows for successive calls with that pointer so essentially one could convert a 1,024 bit value with this algo.

Member Avatar
+0 forum 0

Hey everyone, I'm trying to convert some values to ASCII characters. I understand that this is possible through means of something like this: std::cout << (char)0x31 << std::endl; // prints 1 std::cout << (char)0x4C << std::endl; // prints L However, my problem is that i have char array that contains 4 elements. I'm trying to get each 2 elements from the array and from there use it to get its ASCII values. I took the approach of converting each character to a string and for each pair i added 0x to it. From there i tried to covert each pair …

Member Avatar
Member Avatar
+0 forum 3

Alright, so I am building a Converter to convert ASCII to Binary and for some reason, the for each loop stops working when it hits a space, and I have no idea why. I'm probably just over thinking it. Extra: Can you tell me how to force the output binary to be 8 chars? So add 0's to the front until the length is 8. package com.github.geodox.asciitobinary.main; import java.util.Scanner; public class ASCIItoBinary { private static Scanner input = new Scanner(System.in); public static void main(String[] args) { getInput(); } private static void getInput() { String repChar; String inputString; log("Please Enter a …

Member Avatar
Member Avatar
+0 forum 14

Hello, I'm having some trouble with a £ sign, it's being displayed to the user as the <?> question-mark-in-a-black-diamond icon. I have an SQL Server database with a £ in a table. (Collation Latin_General_C1_AS which is analoguous to 8859-1) I have a PHP script which retreives this record without issue and can display it on a web page OK. This is with the PHP script file's encoding set to UTF-8 without BOM. The issue appears to be displaying the page in an AJAX request. var http = new XMLHttpRequest; ... document.getElementById('myDivElement').innerHTML = http.responseText; http.responseText appears to be treating the results …

Member Avatar
Member Avatar
+0 forum 2

I need the first and last names to be capitalized, so if the user inputs a lowercase, it'll change it to uppercase when it's displayed. But it's just the ASCII and I'm not sure how to fix it. Thanks! #include <iostream> #include <cctype> using std::cout; using std::cin; using std::toupper; char firstname[15], lastname[15]; int f = 0, l = 0; int main() { cout << "Enter your last name: " ; cin >> lastname; cout << "Enter your first name: " ; cin >> firstname; f = toupper (firstname[0]); l = toupper (lastname[0]); cout << "Welcome " << firstname << " …

Member Avatar
Member Avatar
+0 forum 1

#include<stdio.h> #include<stdlib.h> #include<string.h> #define sizeofhash 30 struct nsbh { char nama[100]; char norek[20]; char ttl[40]; char jk[20]; char alamat[30]; char kota[50]; char nohp[15]; int saldo; struct nsbh *next; }; struct nsbh bank; typedef struct nsbh atm; atm *hash[sizeofhash]; atm *a=NULL; atm *b=NULL; atm *c=NULL; //Nasabah bank; //Nasabah * pbank = &bank; FILE *fp; void inithashtable(); int hashFunction(char norek[20]); void menu(); void input_nsbh(); void read(); void inithash(); void display(); void load(); int main() { inithashtable(); int ch; do { menu(); scanf("%d",&ch);scanf("%*c"); switch(ch) { case 1: { printf("Tambah ke FILE\n"); input_nsbh(); break; } case 2: { printf("\n"); read(); break; } case 3: …

Member Avatar
Member Avatar
+0 forum 2

I'm trying to take input keypress event and move the text it would have typed into a textbox to a different textbox instead. textBox1 has a length limit of 1 so I dont actually have to prevent text going into the box because the textbox is already full I just need to put the character that would have been typed into the next textbox **Lines 16 and 24 are the problem afaik** '******************************************************* 'Handle all typeable characters in populated(full) boxes '******************************************************* If (e.KeyCode > 31 And e.KeyCode < 127) Then 'Only handle full textboxes (empty are already handled) If Not …

Member Avatar
Member Avatar
+0 forum 8

I am writting a simple C++ programm and I want to generate outputs to the console but with the functions 'fwrite' and 'printf'. However, I can't print special characters like 'á', 'é', ... Here is a simple code: printf("Special character: 'ñ'"); Were the output was `±` I found that those characters are printed as ascii but they were encoded in Utf8. I don't know how to make this output visible correctly, I'm using the Microsoft Visual Studio. Any help?

Member Avatar
Member Avatar
+0 forum 3

how do you manually convert a multi digit ascii string into the hex equilavent of a decimal integer with out using a C library function. For instance If I have a small program asking a user to type into the keyboard a decimal number and lets say they type in 64357, and if this number is base 10 or decimal, the characters that get sent out a standard uart port would be the ascii equilavent of 0x36, 0x34, 0x33, 0x35, 0x37, on the receiving side of this uart, i would then need a 5 byte (unsigned char) array how do …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am wondering if there is a somewhat simple way to output extended ascii values in c. Basically I am thinking actually about unicode characters, stored in ints. Is there an easy way to do this, or would it require a custom gui console?

Member Avatar
Member Avatar
+0 forum 2

Dear forummembers, Well I am a total noob in visual basic programming, but I want to make a program that opens an ascii file that i choose and reads the file line per line. The ascii file excist as follow 0.0000 Start of measurement time id rx dlc b0 b1 b2 b3 b4 b5 b6 b7 0.3480 C010327x Rx d 8 CF FF FF FF FF FF FF FF 0.3480 18FEF027x Rx d 8 FF FF FF FF FF F0 CC FF 0.3490 18EF4E27x Rx d 8 00 00 00 FF FF FF FF FF 0.3500 18FEF117x Rx d 8 …

Member Avatar
+0 forum 0

Dear all. please kindly but freely provide of your ideas and thought about following. I need to get binary bits of variety of files regardless of ASCII, Unicode, or even non-printable etc. I searched following seems to be commonly used but not for all. bits[i] = ((1<<i) & c) != 0 ? 1:0; bitset<8> qBits(buffer[j]); Will you please provide any other way of getting bits of files??? This is important task for me, and any of your response will highly be appreciated. Thanks in advance for your attention. Sincerely Ted

Member Avatar
Member Avatar
+0 forum 2

Dear All, I have written a code to implement an algorithm for base conversion from decimal to any base between 2 and 36 given in RG Dromey. Below is my code and I have a few questions relating to it: [CODE] #include<stdio.h> #include<stdlib.h> int main() { int newbase,zero=atoi(0),q,ndigit=0,r,ascii,i; char newrep[100]; printf("Enter number and base(between 0 and 36) to be converted"); scanf("%d%d",&q,&newbase); while(q!=0) { r=q%newbase; ndigit+=1; ascii=zero+r; if(ascii>atoi(9)) { ascii=ascii+7; } newrep[ndigit]=(char)ascii; q=q/newbase; } for(i=ndigit;i<=1;i++) { printf("%d",newrep[ndigit]); } system("pause"); return 0; } [/CODE] 1. Why is there a need for reverse conversion to characters of the ascii value after conversion before …

Member Avatar
Member Avatar
+0 forum 6

hi, i m doing a program now. in which i need to get ascii values like SOH, NUL etc from the serial port. i m getting the values as string. i don know how to process the ascii values to obtain the original values back. example my data is SOH NUL = 0x01 0x00

Member Avatar
Member Avatar
+0 forum 5

is the following c++ code for printing the ASCII value of a number correct? [CODE]#include<iostream.h> #include<conio.h> void main() { int a=10; char ch[10]; ch=a; cout<<ch; getch(); } [/CODE]

Member Avatar
Member Avatar
+0 forum 2

Well... im making some kind of graphic engine for console in [B]c++[/B], ASCII based, just for exercise... anyways, i was wandering, can i print text [B]faster[/B]? Right now i'm printing the whole map of characters (pix[160][120]) in a [B]single line[/B], so it is fast, however i need it faster cause the screen is [B]flickering[/B] and it is realy annoying.. help please? im kind of newbie to console input output streaming..

Member Avatar
Member Avatar
+0 forum 7

[b]C# text encoder / decoder[/b] [i][u]Please note that I'm not a professional developer and I might make simple mistakes because of that, I'm also dutch, and 14 years old, so please keep that in mind before you reply. thank you C:[/i][/u] My brother came up with an idea to encode and decode text with a username and a password... When you encode something you have to decode it with the same username and password again, otherwise it will give you a very strange character text. We're going to use this for our website, and I thought it might be nice …

Member Avatar
Member Avatar
+0 forum 1

Hello Guys, Well i have a problem, I coded a program to print the ascii table, then give the user a option to either convert character into ascii or ASCII to character. Well the latter is not working, and the loop to print the ascii table is having the same trouble. Well I did that loop earlier, but there i used the characters as it is, having to make the loop little Inefficient. Here i want it to be done in this way... But Explicit conversion of int to char is causing the trouble.... Please help me out... Here is …

Member Avatar
Member Avatar
+0 forum 14

Hey forum, our professor assigned us a program we have to write in assembly language and I would love to have help on it. [QUOTE]Write an upper-to-lower case and lower-to-upper case conversion program. When the user inputs a letter, your program should convert it to upper case if it is in lower case, or to lower case if it is a capital letter. Continue converting and displaying the results until the user presses the ‘enter’ key with no input. (You can do these conversions by adding or subtracting the appropriate hex value. Check your ASCII chart). If the user inputs …

Member Avatar
Member Avatar
+0 forum 7

Hello Daniweb! :) I am brand new to this site, and wish I didn't need the help but I do! So let's give it a go shall we? I have a program I have been working on for about two weeks now, and I feel like it should not be taking me this long. So here I am, in need of the almighty Daniweb. I have looked at previous threads like requested, but none of them really seemed to speak to my cause, or answer my question. I am using file descriptors, and most of the other threads were not. …

Member Avatar
Member Avatar
+0 forum 1

Ok, so basically I have an assignment in which I have to determine if what the user typed in is a number between 0-9, a letter or a symbol. The commands I can use are: [CODE]cout endl system("pause") system("cls") #include<iomanip> setw(#) setfill('ch') "\t" cin getline(cin,s) bool char int double string #include<string> #include<cmath> #include<windows.h> → directiva utilizada para poder el comando de ::Sleep() ::Sleep(#) n.length() && || IF/ELSE: -----if(condición) -----{ -------// código -----}else{ -------// código -----} (t)x → changes the variable x to variable type t SWITCH: -----switch(variable) -----{ ----------case n : // código -------------------break; ----------default : // código --------------------break; -----} …

Member Avatar
Member Avatar
+0 forum 9

Hi, I am brand new to programming all together and was kind of thrown into a programming class without much help and I have struggled with my homework for this week. I have to create a code to write an ASCII table using Python 2.6 . Here is the actual problem that I was assigned: PROBLEM 1 (35 points) Write a Python program that will produce the following ASCII Table. Be sure that the heading is centered compared to the table. Be sure to use the center string method and also Python’s formatting strings to get the table. ASCII TABLE …

Member Avatar
Member Avatar
+0 forum 2

Alright back with the same but different example problem but this time I think it requires some "formating" and knowledge of "escape characters". As a novice programmer this is the caliber of trouble I am going through lol. Does this need knowledge of escape characters as well ? ("\t") would this just be the rearrangement of that certain character? [CODE] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleAppBannerOutput { class CommentBanner { static void Main() { Console.WriteLine("**********************************************"); Console.WriteLine("Programming Assignment #4\t"); Console.WriteLine("Developer:\tAlma Kind"); Console.WriteLine("Date Submitted:\t September 17"); Console.WriteLine("Purpose: Provide internal documentation"); Console.WriteLine("**********************************************"); Console.ReadKey(); } } }[/CODE] the output should …

Member Avatar
Member Avatar
+0 forum 2

Ok so here is the problem... this is my code: [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DesignOutput { class Assignment { static void Main() { Console.WriteLine("CCCCCCCCCC"); Console.WriteLine("CC\t\t##\t##"); Console.WriteLine("CC\t\t##############"); Console.WriteLine("CC\t\t##\t##"); Console.WriteLine("CC\t\t##############"); Console.WriteLine("CC\t\t##\t##"); Console.WriteLine("CCCCCCCCCC"); Console.ReadKey(); } } } [/CODE] Im trying to match this: [CODE]CCCCCCCCCCC CC ## ## CC ############## CC ## ## CC ############## CC ## ## CCCCCCCCCC [/CODE] the " ##" in lines 2,4,6 (first set) need to be pushed basically one more unit to the right in order for everything to align up, but I dont know if that cant be done I tried experimenting with …

Member Avatar
Member Avatar
+0 forum 2

Hello, I'm currently trying to figure out how I can get the information in ASE file and put it in my own arrays. Heres an example of ASCII scene export: [CODE]*3DSMAX_ASCIIEXPORT 200 *COMMENT "AsciiExport Version 2,00 - Fri Aug 26 13:58:27 2011" *SCENE { *SCENE_FILENAME "" *SCENE_FIRSTFRAME 0 *SCENE_LASTFRAME 100 *SCENE_FRAMESPEED 30 *SCENE_TICKSPERFRAME 160 *SCENE_BACKGROUND_STATIC 0.0000 0.0000 0.0000 *SCENE_AMBIENT_STATIC 0.0000 0.0000 0.0000 } *GEOMOBJECT { *NODE_NAME "Box01" *NODE_TM { *NODE_NAME "Box01" *INHERIT_POS 0 0 0 *INHERIT_ROT 0 0 0 *INHERIT_SCL 0 0 0 *TM_ROW0 1.0000 0.0000 0.0000 *TM_ROW1 0.0000 1.0000 0.0000 *TM_ROW2 0.0000 0.0000 1.0000 *TM_ROW3 1.6543 1.0676 0.0000 *TM_POS …

Member Avatar
Member Avatar
+0 forum 5

I would really like to be able to read notification emails on my phone (email to sms). However, my email preferences on daniweb are currently set to html, as far as I know. Could someone please help me change it to plain text? Is it even possible? Thank you.

Member Avatar
Member Avatar
+0 forum 2

Hi, I am looking to find 3 and 5 digit characters convert into hex byte or word. For example 69 string represents 69 decimal and 45 hex. Then '6' = 36h and '9'= 39h. 43690 = AAAA example. I need done it in Freescale (motorola) assembly for my communication machine with human online.

Member Avatar
+0 forum 0

You can become crazy with this problem. Lets see this other quick solution to compare strings. Remember that strings are a sequence of bytes. home : h(first byte),o(second byte),...,e(last byte),0 a tag to identify the end of the string. Suppose you have a string inside a register : %esi and you want to compare only the first character with another one : zero: .ascii "0" leal zero,%edi cmpsb #this command compares the first byte(the first character) of the strings inside the registers ESI,EDI. #Some examples of what you can do now : je label1 #jump to label 1 if the …

Member Avatar
Member Avatar
+0 forum 1

The problem states to use a loop display character from the ASCII codes 0 through 127 and to display 16 character per line. I am using Borland C++ 4.5 so I need the older programming way of doing it. This is what i have so far. [CODE]#include <iostream.h> int main() { for (char letter = 0; letter < 127; letter++) { for (int num = 0; num <= 16; num++) { cout << letter; if (num == 16) break; } cout << endl; } return 0; }[/CODE] What this does is repeat the same ASCII character over and over on …

Member Avatar
Member Avatar
+0 forum 9

The End.