Solved

ANSCII Code

Posted on 2000-02-26
2
307 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
ID: 2561530
#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
ID: 2561602
// 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

733 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