Solved

ANSCII Code

Posted on 2000-02-26
2
273 Views
Last Modified: 2012-06-27
Hi, all experts

  Do any body know the ANSCII code for

border like MS WORD (ex. |========) for console program or dos enviroment. I am not really sure it is probably around 2 hundred something...  

Any body have an idea and want to challeng

Ly





 
0
Comment
Question by:lseng
  • 2
2 Comments
 
LVL 1

Expert Comment

by:roaknog
Comment Utility
#include <stdio.h>

void main(){
for(int i= 0; i < 70; i++){
 printf("%c",char(205));}
}
0
 
LVL 1

Accepted Solution

by:
roaknog earned 3 total points
Comment Utility
// for a square
#include <stdio.h>

void main(){
      int c = 0, r = 0, letter = 0, rows = 20, collumns = 40;

      for(r = 0; r < rows+1; r++){
      for(c = 0; c < collumns+1; c++){
// conditions
            if((r == 0 || r == rows) && (c > 0 && c < collumns))letter = 205;//top and bottom
            if(r == 0 && c == 0) letter = 201;// top left
            if(r == 0 && c == collumns)letter = 187;// top right
            if(r == rows && c == 0) letter = 200;// bottom left
            if(r == rows && c == collumns)letter = 188;// botoom right
            if(r > 0 && r < rows && c > 0 && c < collumns)letter = 32;//center
            if((r > 0 && r < rows) && (c == 0 || c == collumns))letter = 186;//sides
      printf("%c",char(letter));}
      printf("\n");}}
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now