C :: How To Display Characters In Binary

Feb 5, 2015

I know how loops work. I know about bitmasks and how to display characters in binary. How should i proceed now in order to make an app that consists of online booking or knowing someones location.

View 3 Replies


ADVERTISEMENT

C :: Binary To Decimal Conversion Through A Port To Display On LCD Display

Dec 6, 2013

I know this is more simple than I am making it out to be. I have a solar panel hooked up to an 8-Bit ADC and linked into my Microprocessor. I am trying to take the Binary readout from the ADC and convert it to a decimal number to be displayed on the boards LCD display. I am wiring the ADC to PORTA on my Motorola Freescale Board. This is for a final project for my electronic systems class due on Monday...

View 3 Replies View Related

C :: Display Numbers That Are Passed As Literal ASCII Characters To LCD

Mar 20, 2014

What shall I learn in order to send values from 0.00 to 5.00? I'm working with they Hitachi 16x2 LCD display.I've been sending/displaying literal values on it all day.

Code:

SendCharater(unsigned char val)

where the variable val corresponds to the LCD character table.I can also send Hello World to the display, like so:

Code:

void putsXLCD(unsigned char *buffer){
while(*buffer) // Write data to LCD up to null
{
while( BusyXLCD() ); // Wait while LCD is busy
SendCharacter(*buffer); // Write character to LCD
buffer++; // Increment buffer
}
return;
}

I could type in putsXLCD("5.00") in order to display it on the LCD, but how do I implement this automatically for values, e.g. 0.00 to 5.00?It appears I can only pass literal values through the function SendCharacter, meaning that in order to display "0" I have to pass the value 0x30 (the hex value of "0" on the LCD Table).

My current thought process:Much like passing "Hello World" in the function putsXLCD(), I need to assign a pointer that points at each value in the "array" that I need to send. E.g., I need to send 3.24, so I need to point to "3", fetch the corresponding hex value in the LCD table, in this case 0x34, and the pass this 0x34 into the SendCharacter function, and so on. So, if this is the case, how can I fetch the corresponding hex value?

View 7 Replies View Related

C Sharp :: How To Display Urdu Unicode Characters On Windows Forms

Aug 3, 2012

I tried to get the Urdu Fonts from MySql Database using C# in Visual Studio 2010 in Windows Forms Application. When I get the value from table into my variable it shows the characters in ???? symbols. But in PHP i have used the following code:

<?php 
class CRUD {
var $con; 
//function to make connection to database

[Code].....

View 3 Replies View Related

C++ :: Separate Binary String Every 4 Characters - How To Add Spaces To Output

Sep 28, 2014

I want to separate this binary string every 4 characters..I am trying to get a better understanding of how variables are stored in memory and I am looking at their binary address for a pattern..I see a pattern for the last 4 bits

#include <iostream>
#include <bitset>
int main() {
using namespace std;
int x[100];

[Code] ....

View 2 Replies View Related

C++ :: Display Numbers In Binary Search Tree - Getting 0s

Jan 31, 2015

I want to display the numbers in a bst but all I get are 0s, what is wrong with my code that is causing this?

#include <iostream>
using namespace std;
class binarySearchTree {
private:
class TreeNode {
friend class binarySearchTree;
int value;

[Code] ....

View 1 Replies View Related

C/C++ :: Display Number Of Comparisons Using Binary Search

Apr 23, 2015

My assignment is "Search Benchmarks: Write a program that has a sorted array of at least 20 integers. It should call a function that uses the linear search algorithm to locate one of the values. The function should keep a count of the number of comparisons it makes until it finds the value. The program then should call a function that uses the binary search algorithm to locate the same value. It should also keep count of the number of comparisons it makes. Display these values on the screen."

I'm unsure how to make it show the number of comparisons it takes to find the value for the binarySearch function. Also, where to put the selectionSort function the teacher said we need. This is what I have...

#include <iostream>
using namespace std;
int linearSearch(const int a[], int num);
int binarySearch(const int a[], int num);
void selectionSort(int a[]);

[Code] .....

View 1 Replies View Related

C++ :: User To Enter Decimal Value Then Display Its Corresponding Binary Numbers

Sep 13, 2013

Create a program that will ask the user to enter a decimal value (1-999999) then display its corresponding binary numbers. Repeat this process until the value entered is equal to 0. Use the following Function Prototype:

void BinCodes(int value);
Sample Input/Output:
Enter a Decimal: 35
Binary: 100011
Enter a Decimal: 184
Binary: 10111000
Enter a Decimal: 0

View 4 Replies View Related

C/C++ :: Display Contents Of Binary Tree In Per-level Format - Undefined Reference

Oct 5, 2014

I am coding in C++ an implementation of BTree Insertion. I want to display the contents of the Tree in a per-level format. After writing functions and trying to run. I get the error Undefined reference.

// C++ program for B-Tree insertion
#include<iostream>
using namespace std;

// A BTree node
class BTreeNode{
int *keys; // An array of keys
int order; // Minimum degree (defines the range for number of keys)
BTreeNode **child; // An array of child pointers
int size; // Current number of keys

[Code] .....

View 6 Replies View Related

C :: How To Print Characters But No String Just Array Of Characters

Mar 20, 2014

so my question is i want to print characters,no string just an array of characters,i do this but it s not working,maybe i have to put the '' at the end?

Code:

int main() {
int i;
char ch[5];
for(i = 0; i < 5; i++) {
scanf("%c",&ch[i]);

[Code]...

View 6 Replies View Related

C/C++ :: Find The Common Characters Between Two String Characters

Jul 6, 2014

Im supposed to find the common characters between two string characters, assuming that the user wont input duplicate letters like ddog. When I run my code I get an output of a question mark upside down. Here is my code with comments on what each part is supposed to do

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char str1[20], str2[20],remp = '';
int size1,i,j,temp;
printf ("Input the first string");

[Code]...

View 6 Replies View Related

C/C++ :: Check For Set Of Characters In Array Of Characters?

Mar 26, 2014

I have an array of characters. I am trying to find "houston". The only way I can think of to do this is to use a for loop and check each individual character. Is there an easier way to do this?

char string[] = "Fishing tourism miami atlanta dallas houston";

View 9 Replies View Related

C/C++ :: Call To String Function To Display Names In Class Not Display

Apr 19, 2014

I created class called students which suppose to store students names of in array but when I call the display function it display only the first name. but I want it to display names depending on the array size.

#include <iostream>
#include <sstream>
using namespace std;
const int SIZE=5;

[Code]....

View 3 Replies View Related

C :: Binary File Write By User Input Then Printing Binary File Data Out

Dec 6, 2013

Following is the program I wrote it basically takes 9 inputs and then save them into binary file. then print out the data stored in binary data and find inverse of it then print the inverse out. but its stuck in a loop somewhere.

Code:
#include <stdio.h>
int main() {
int a[3][3],i,j;
float determinant=0;
int x;
FILE *fp = fopen ("file.bin", "wb");

[Code] .....

View 6 Replies View Related

C :: Cannot Print Characters In The End

Feb 7, 2014

I cant print the characters in the end.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
FILE *arquivo1,*arquivo2,*arquivo3;//files i will open//
char texto;//texto= character i will read.

[Code]...

View 5 Replies View Related

C++ :: How To Use Unicode Characters

Jan 25, 2015

I'm trying to have a button marked by the sqrt sign, '√'.

I wrote below code and typed that sign by holding down "alt" and typing 251 using numpad. But result is the question mark instead of sqrt mark!

My machine is Windows 7 x86 and IDE is visual studio 2012.

#include <GUI.h>
using namespace Graph_lib;
//---------------------------------
class Test : public Window {
public:
Test(Point, int, int, const string&);

[Code] .....

View 3 Replies View Related

C++ :: How To Do Substring To Get Last 4 Characters

May 8, 2013

let says i have char *yytext = "p103_stb" 0r "p0_stb" or "p100_stb"

How to do substr to get the "_stb" in C?

View 12 Replies View Related

C/C++ :: Use Characters In If Statement?

Oct 15, 2014

#include <stdio.h>
#include <math.h>
int main(void)
{

[Code]....

That's my code above and I'm getting an error saying that I'm "implicitly declaring library function 'strcmp' with type 'int(const char*, const chat*)". When i run this program and enter in Black for the first prompt, the program stops. I'm trying to make this program so that when I enter Black as the answer for the first prompt, the program will display the value 10.

View 1 Replies View Related

C :: Dynamic List Of Characters

Oct 17, 2014

i just need clarification on if this is what is considered a dynamic list of characters, i don't want a linked list.

Code:

struct dlist {
int size;
int maxsize;
char *datafield;
};

View 6 Replies View Related

C :: Compress Array Of Characters

Mar 15, 2014

I am trying to write a function compress() that takes in an input of a 2-dimensional array (5x10) of character data, compresses each row of the array by replacing each run of character with a single character and the number of times it occurs, and prints on each line the result of compression in the function. For example, the row with data aabbcdddee may be compressed into a2b2c1d3e2.

Input (5x10 of characters):
aaacccdeee
sssseeeedd
aaaaaaaccc
eeedddasee
ddeeeeeggg

Output:
a3c3d1e3
s4e4d2
a7c3
e3d3a1s1e2
d2e5g3

I could achieve the compression part, but behind the compressed array, it printed out 5 extra lines of alien ASCI code, followed by printing out 5 times of everything .

Code:

void compress(char data[SIZE1][SIZE2])
{
int i,j, k,l ,count;
char data123;
printf("Enter your data (5x10 of characters): ");
for (i=0; i < SIZE1; i++) {
for (j=0; j < SIZE2; j++)
data[i][j] = getchar();
fflush(stdin);
}

[code]....

View 3 Replies View Related

C :: Isolate Characters Between The Brackets

Sep 3, 2013

I have a character array that will have a prefix and then a filename that will be between two square brackets. Something like this;

get[filename]

I need to isolate the characters between the brackets. Here is my attempt:

Code:
char* get_filename(char selection[]) {
char* ptr;
char* rv;
char* temp;
ptr = strtok(selection, "[");
ptr = strtok(NULL, "[");

[Code] ....

But of course, this isn't working.

View 4 Replies View Related

C :: Draw A Grid Using The Characters?

Aug 20, 2013

I'm trying to create a grid using the following characters: !, @, #, $, &.

It's an 8 x 8 grid, and should contain the characters in no particular order (trying to create a Bejeweled-like game).

I already defined the width and length to be 8, so:

#define WIDTH 8
#define LENGTH 8

Code:

void makegrid(char grid[])
{
int j;
int k;
for ( j = -1; j < LENGTH; j++ )
{
for ( k = -1; k < WIDTH; k++ )
{
/* I don't know what to type here anymore :( */
}
} }

View 14 Replies View Related

C :: Reading Characters From A File

Mar 19, 2013

if i start reading individual characters from a text file having the following content: "music, Indian classical dance, and other aspects of Indian culture.It is also a movement with chapters in over 200 towns and" what are the characters that will be read after the word 'culture.' ?

will it be '
' , '
' , 'I' and so on

View 2 Replies View Related

C :: How To Read The Characters Into Array

Jan 27, 2014

I have written this program to copy all the characters input from the keyboard into the array till a "?" mark is entered. what is the error i am doing. I am getting a run time error in this case.

Code:

void word_reversal(void) {
char array[100];
int index=0;
printf("Enter the number of characters less than 100
");
do {
scanf("%c",&array[index++]);
}while(array[index] != '?');
}

View 8 Replies View Related

C :: How To Read Characters From File

Dec 29, 2014

I'm new with C language. I got task to do . Actually there are 2 points. Both should be done with reading text from file. write down all letters from text in reverse alphabetic order (each letter 1 time).write down all words in random order.

I'm stuck with first point. Below code gives me entire text, but i need unique characters only. Text file contains few sentences.

Code:
#include<stdio.h>
void main( ) {
FILE *in;
int ch;
if ( (in = fopen("test.txt", "r") ) != NULL ) {

[Code] ....

View 7 Replies View Related

C++ ::  Validating Characters In A Stack

Oct 7, 2014

Validation opening/closing brackets.

I had the entire validation working until my professor said that my Pop function had to be a "void" not a "Char". Which destroyed my previous validation and now how to validate this.

I will only be posting the validating function.

All the characters are being thrown in a Stack. So I am using Pop/Top/Push/isEmpty/isFull. That will be shown in my validating code.

Correct Validations:
1. {}()[]
2. [()]
3. {([])}

Incorrect Validations:
1.[)
2.[(]]
3.{])

My main issue is that it validates "[)" correct.

I am pretty positive I must have over complicated my validation.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved