Thread: cpp to html

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    98

    cpp to html

    I want to convert my source c++ code into html ,
    and make keyword to highlight.
    I have find some covertion software ,
    but it's not support html code in this site.
    I have to convert html tags into vb code tags,
    it wasted another editing time, no good idea,
    So, someone know maybe there are some software
    can directly convert cpp to sth with vb code tags ?
    Thanks.

    Code:
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    
    typedef struct
    {
    char morse[6];
    char letter;
    }morsecode;
    
    int main(){
    
    morsecode trans[36]={
    {".-", 65}, {"-...", 66}, {"-.-.", 67}, {"-..", 68}, {".", 69}, {"..-.", 70},
    {"--.", 71}, {"....", 72}, {"..", 73}, {".---", 74}, {"-.-", 75}, {".-..", 76},
    {"--", 77}, {"-.", 78}, {"---", 79}, {".--.", 80}, {"--.-", 81}, {".-.", 82}, 
    {"...", 83}, {"-", 84}, {"..-", 85}, {"...-", 86}, {".--", 87}, {"-..-", 88},
    {"-.--", 89}, {"--..", 90}, {"-----", 48}, {".----", 49}, {"..---", 50},
    {"...--", 51}, {"....-", 52}, {".....", 53}, {"-....", 54}, {"--...", 55},
    {"---..", 56}, {"----.", 57}
    };
    char phrase[34] = {"DUDE WHERES THE 1978 GOGGO MOBILE"};
    int search, index; 
    for(index = 0; index <= 33; index++){
    for(search = 0; search <= 35; search++){
    if(trans[search].letter == phrase[index]){
    printf("%s ", trans[search].morse); }else if(phrase[index] == ' '){
    printf(" ");
    }else{
    printf("\nError Char not found!!!\n");
    }
    }
    } 
    
    return 0;
    }
    Last edited by toysoldier; 08-16-2004 at 12:26 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help - C code creates dynamic HTML
    By Christie2008 in forum C Programming
    Replies: 19
    Last Post: 04-02-2008, 07:36 PM
  2. Replies: 2
    Last Post: 04-09-2006, 07:20 PM
  3. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  4. Design + HTML
    By orbitz in forum C Programming
    Replies: 8
    Last Post: 11-21-2002, 06:32 AM