C :: Creating Table With ASCII Codes?

Apr 6, 2014

I have a C program where I rapprendentare a table using a 10x10 matrix and create the chart with the game piece and the matrix in a spiral. I do not know how to start or even how to create the table with the ascii codes. is a task for school and I need to do it soon.

View 1 Replies


ADVERTISEMENT

C++ ::  displaying ASCII Codes In 2D Array?

Apr 20, 2014

this is my original code:

#include <iostream>
#include<fstream>
#include <string>
using namespace std;
string display(string);
main() {

[code]....

here is what it does;it reads from a text file and converts the characters to ascii numbers and stores them in 1D array.what I am trying to is storing these ascii codes in 2D array.

View 5 Replies View Related

C/C++ :: Sorting Characters In Their ASCII Codes

Mar 25, 2015

I'm trying to write a lot of sample code to practice but I can not figure out how to take a string and sort each character in order of their increasing ASCII codes. I'm getting stuck trying to separate each letter to determine it's ASCII code. I know I have to use an array somehow, So far, this is my code:

#include <stdio.h>
#include <stdlib.h>
#define _CRT_SECURE_NO_WARNINGS

[Code].....

View 4 Replies View Related

C/C++ :: Printing Table Of ASCII Chars - Cannot Initialize Variable

Apr 9, 2014

I'm trying to write a program which prints a table of ASCII chars, I'm not really done with my thoughts on it but I already
ran into the following error:

Error: cannot initialize a variable of type 'char' with an rvalue of type 'char (*)[16]'

Here's my code so far:

# include <iostream>
using namespace std;
int main() {
char asciiTable = new char[8][16];
int nextSign = 0;

[Code] .....

View 4 Replies View Related

C/C++ :: Creating Gradebook In A Table

Nov 6, 2014

I'm unable to get the grades to print in the table format, it only takes the homework grades and not the tests and quizes.

// week 8.cpp : Defines the entry point for the console application.
// Gradebook 1.cpp :

/*Rewrite the program "Gradebook 1" to contain 1-dimensional arrays. All information entered or calculated within the program is located in an array. The final output(Class Summary) should contain a summary sheet that contains all of the information in table form. */

#include "stdafx.h"
#include <stdio.h>
#define Size 30//Maximum class size
#define max 100//maximum grade
#define min 0//minimum grade

[Code] .....

This is my result :

Welcome to the Gradebook Program.

Please enter the number of students: 2
Enter the number of Tests to be averaged: 2
Enter the number of Quizzes to be averaged: 2
Enter the number of Homework assignments to be averaged: 2

[Code] .....

View 4 Replies View Related

C++ :: Creating Table Of Arrays - Find Maximum Value And Sum

Aug 12, 2014

I have an array of "2,3,4,5,6,9,10,11,12,99". I need to create a table of this which i have done using case

1. Find the maximum value of the array
2. Find the sum of the first and last element of the array
3. Swap the adjacent pairs of arrays
4. Display the values in array
5. Quit

Please enter choice:

but when i try running the program i did i keep having the break or continue pop up ....

#include <iostream>
using namespace std;
int main() {
int choice;
int number[10] = {2,3,4,5,6,9,10,11,12,99};

[Code] .....

View 6 Replies View Related

C :: Vector Usage In Codes

Sep 19, 2014

Now i am utilizing vectors in my codes.If i want to make a vector and i use #define to put a limit on the amount of variables it can contain. Until now i can do that. But let's suppose that i put 40 variables as its max capacity, but an user just needs to use only 12 or 14 variables. Put a rule that if someone has finished inserting his data and he is yet to fill the whole capacity of the vector the code.As to say : "If case you want to end press 0" .Edited : My computer has windows 7 and i took Codeblocks as my editor.

View 2 Replies View Related

C++ :: Stopping Codes With A Key Press

Feb 25, 2013

I have a program that I made, which does a list of stuff, then checks if a key is pressed, and if it's pressed, stop the looping.

The problem is, it checks if the key is pressed once a loop, which means that if the list has delays, you have to hold the button down for a while (depending on the list).

Here's an example:
Move mouse;
Pause program for 2 seconds;
Move mouse;
Pause program for 2 seconds;
Check if key is pressed;

What ways can I fix this problem?

View 1 Replies View Related

C++ :: Store HTML Codes For Different Characters In Array

Jul 17, 2013

I am trying to store the HTML codes for different characters in an array, but I am not sure how to do this, so that when using the keybd_event it can be plugged in.

If you try to do it with a string for storing the HTML code, you get this error.

string HTML[1];
HTML[0] = "A"; //A
keybd_event(HTML[0], 0, 0, 0);

I could do it in a very long if/else statement, but this would be much easier to call and get data from, and take up less space.

View 1 Replies View Related

C/C++ :: How To Access Files Of A Computer Through Batch Operating Codes

Oct 21, 2013

How to use c programming codes or batch operating codes to access files from our computer.

View 1 Replies View Related

Visual C++ :: Define A Range Of Exit Codes In Application?

Feb 10, 2015

I want to define a range of exit codes in my application. These codes will be used as a return value of ExitInstance function. I want to know the exit codes availables (values not used for example by windows to inform about an other error). When I force to crash my application, I get some different error codes: 8148, 10176.

What is the no available range exit codes?

Is this the ranges code unavailable?

[URL]

View 1 Replies View Related

C++ :: Hash Table Program - Sorting Pointer Table After All Of Values Entered

Nov 19, 2013

I am having an issue with my sort function. This is one part of the Hash table program. The main issue is that I am trying to sort the pointer table after all of the values have been entered. The ptr_sort function is not a class function and so I am therefore unable to use the class variables psize and pTable. Is there another way I should be trying this? it is a Vector should I use the sort() function from the vector class in STL?

#include "/home/onyuksel/courses/340/progs/13f/p9/util9.h"
#include "/home/onyuksel/courses/340/progs/13f/p9/hTable.h"

#ifndef H_TABLE1
#define H_TABLE1
void ptr_sort ( );

[Code] ....

View 1 Replies View Related

C++ :: Truth Table Generator - If User Enters String Of Boolean Algebra It Will Output Table

Jan 25, 2013

If a user enters a string of boolean algebra it will ouput the table.

I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.

How to dynamically create the function, how to implement it.

BTW This is a console function, if that changes anything.

View 2 Replies View Related

C# :: Lookup Non-existent Rows In MySQL Table And Then Update Another Table

Dec 15, 2014

I have written an SQL statement that would:

1) Count the number of rows in the table booking that are open and where the booking.postcode is "MK",

2) Take a note of the plot (in booking.plot_id), and then update the table plot.jobs with the value count.

For example running the SQL query when booking table has the following rows:

Would see the following highlighted values in plot.jobs being updated to 1:

I managed to resolve it with this code so far (note I am using Connector/Net):

public void RefreshPlot(){
string query =
"SELECT Count(*) AS count, plot_id FROM booking WHERE postcode='MK' AND status='open' GROUP BY plot_id";
var cmd = new MySqlCommand(query, _connection);
var da = new MySqlDataAdapter(cmd);
var dtCounts = new DataTable();
da.Fill(dtCounts);

[code]....

Currently, my code only checks for existing rows in the booking table and updates the plot table. However if the row gets deleted in the booking, then the changes are not reflected in the plot table.

Example: If we delete the row with plot.id=1 and plot.plot_id=4, then booking.plot_id should go back to being 0, if it was initially 1. At the moment, it doesn't. How would I update my SQL statement to better reflect this? In a sense, it should check for "non-existent" rows, i.e. the impact that the row plot.plot_id=4 & plot.id=1 has on booking.plot_id when deleted?

View 6 Replies View Related

C Sharp :: Copy Data Table To MySQL Table

Mar 25, 2013

I have a C# .NET Application which get data from QuickBooks via the ODBC Driver and save the result to C# data table. So, I want to transfer this data table to a mysql table on my own server. That's the code I use:
 
using System.IO;
using MySql.Data.MySqlClient;
//Add mysql dll on the .NET Tab in Project's references  
string connStr = "DSN=QBTest;";  
            string myServerAddress = "192.168.0.243";
            string myDataBase = "CostTest";

[Code] ....

View 2 Replies View Related

C# :: Use Table Adapter With Textboxes To Edit SQL Table?

Mar 8, 2015

I am a bit stumped with trying to write some code to get the tableadapter/binding source to "update" a current 'user' to the table.

I have the insert/delete methods working fine, but it's the updating that has got me screwed up.

Example of insert.

try
{
personTableAdapter.Insert(tFirstName.Text, tSurname.Text, Convert.ToDateTime(tDoB.Text), tPhone.Text, tAdd1.Text, tAdd2.Text, tSuburb.Text, tState.Text, tPostcode.Text, TeacherType.Text);
teacherTableAdapter.Insert(Convert.ToInt32(tTID1.Text), tRegNo.Text, tPassword.Text);

[Code]....

I also tried to do the updated string/original string with the tableadapter.update, but that didn't work either.

View 7 Replies View Related

C++ :: How To Use ASCII Art In C

Feb 26, 2014

How do I print this without generating errors?

Code:

printf(" ||====================================================================||
");
printf(" ||//$///////////////////////////////$||
");
printf(" ||(100)==================| RESERVE BANK OF INDIA|================(100)||
");
printf(" ||$// ~ '------========--------' $//||

[code].....

View 8 Replies View Related

C++ :: Convert Hex To ASCII

May 7, 2013

I want to convert Hex:390041 to ascii "90A",

39: 9
00: 0 -->Null
41: A

i am getting only "9" in the bytearray,i know 0 is terminating the array

unsigned int bytes[3];
int j=0,counter=0;
char c[2];

[Code]....

View 1 Replies View Related

C++ :: Subtracting ASCII Hex Value In 64 Bit Hex Value

Mar 31, 2015

I have some ascii characters in a char variable.ex - char buf[100]="ab*(z&";

So each of the char in that char array will have some hex value.ex- *'s hex value is '2a'.

And I have a long long int variable in which there is a 64 bit hex value.

ex- long long int k=0x0000888888888888;

Now i want to subtract the char buff's hex value in k. How to accomplish it.

That is 0x0000888888888888
- 0x000061622a287a26
= 0x000027265e600e62 (final result in a buffer or a long variable is okay)

Later i want to reverse the result as 26e006e56272.It should be stored in a variable such that i should be able to access each byte from it(ex- '72'(last 2 hex digits))

View 1 Replies View Related

C :: How To Find ASCII Value Of Given String

Aug 25, 2013

I know how to find find ASCII value of given character, but I am not getting how to find ASCII value of given string. For example I want to find ASCII value of string "HELLO",so how to do that.

View 13 Replies View Related

C :: How To Get ASCII Value Of A Char In A String

Mar 4, 2013

how can I find ASCII value (0..255) of a character char in a string?

I have an array of char:

Code: char myarray[50]; and I need to have ASCII value of character eg myarray[10]. How can I do that?

View 1 Replies View Related

C/C++ :: ASCII Art For Different Triangles And Pyramid

Mar 15, 2015

I have to Write a program to produce that makes four triangles and a pyramid. I have to ask the user they height of the triangle and prevent the user from entering a height any larger than 25. It should look like this.

Enter the height of your triangle/pyramid: 3

***
**
*

*
**
***

*
**
***

***
**
*

*
***
*****

im having tourble with 3 and 4th and also pyramid.

HERES WHAT I HAVE SO FAR.

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main () {
int input = 0;
cout << "Please enter the height of your triangle/pyramid: ";

[Code] .....

View 2 Replies View Related

C/C++ :: Wrapping Alphabet Using ASCII

Jan 26, 2011

I'm currently working on a project that utilitzes a Caesar Cipher. Basically, it reads input from a file and then, depending upon the input file, requires encrypting or decrypting. The cipher used to encrypt/decrypt simply adds/subtracts an integer from each character in the input file. All input is lowercase alphabetic characters (ASCII 97-122). My problem is trying to figure out how to wrap the ciphered characters, e.g., if the cipher require a shift of +5 and the character read was 'x', a shift of +5 to the right would produce 'c' (beginning with 'x' and counting up 5 letters: 'y', 'z', 'a', 'b', 'c').

I've written some crude and cumbersome loops that will work, but there has to be a better way. It is my understanding that it can be done using the modulus operation, %, but I cannot figure out how. I spent several hours trying to figure out the modulus approach, but no luck.

View 6 Replies View Related

C++ :: How To Convert Bytes To ASCII

Feb 7, 2014

How can I convert bytes to ASCII?, I read wikipedia about UTF-8 and I understood a little bit about add or split bytes to change the value.

Now I have those bytes

0xC7 0xE6 0xC2 0x91 0x93 0x7B 0xCE 0x01

And I found a program (DCode) that convert to 64 bits little-endian, supposedly those bytes in ASCII is this.

lun, 08 julio 2013 04:28:17 UTC <---

View 3 Replies View Related

C :: Create ASCII Bar Graph Of Die Rolls

May 24, 2013

for an assignment we need to create basically a program that asks the user for the result of standard six-sided die rolls (numbers from 1 to 6). The program will prompt the user with "Enter a die roll or 0 to exit " for the first entry and Next die roll? for all subsequent entries. The program will continue reading die rolls from the user until the user enters 0. At this point, the program prints two newline characters (one blank line) and finally, the bar chart showing the number of times each die roll has been entered, and then terminates.If the user enters an invalid number, the program will just ignore it, and ask for another number. Only numbers 1-6 inclusive and 0 are valid.

Example output Enter a die roll or 0 to exit 6 Next die roll? 6 Next die roll? 7 Next die roll? 4 Next die roll? 0

[code].....

View 3 Replies View Related

C++ :: Sorting Alpha Characters Not ASCII?

Nov 7, 2013

I am looking for a way to sort a string just by the alpha characters, not by the ASCII table. Therefore

string sort(string name) {
sort(name.begin(), name.end());
return name;
}

will not work. And I am looking for the most simple way to go about it!

View 7 Replies View Related







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