-
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;
}
-
What the hell is this supposed to be? do you have a question?
I mean wtf?!
where is cheez when you need him?!? CHHHHHEEEEEEEEZZZZZ! let go of that damn bottle!
um, yeah.
-
and one more thing....i think this is the widest post I have ever seen.
-
test again:
Code:
#include <iostream>
#include <conio.h>
#include <cstdlib>
using namespace std;
int main()
{
char m[4]="toy"; //4th character is '\0' (null).
char n[4]="000"; //same as above.
//char m[3]={'t','o','y'}; //to save original password.
//char n[3]={'0','0','0'}; //initialize your entering password.
cout<<"Please enter 3 bit password: "<<flush;
n[0]=getch(); //enter word ,but no display it
cout<<"*"<<flush; //when enter word, display “*”
n[1]=getch();
cout<<"*"<<flush;
n[2]=getch();
cout<<"*"<<endl;
if(strcmp(m, n) == 0) //compare the strings m and n
//if(m[0]==n[0]&&m[1]==n[1]&&m[2]==n[2]) //stupid code!
{
cout<<"password correct,welcome!"<<endl;
}
else
{
cout<<"error."<<endl;
}
system("pause"); //pause running window.
return 0 ;
}
-
-
dev c++ has an export to html feature
#include <stdio.h>
int main(void)
{
printf("Hello world");
return 0;
}
-
You could also use the php tag instead of code. It has coloring, though it's different from the normal C++ editor.
-
i like the [source] [/source] tags over at www.gamedev.net
they have msvc++ style colouring
-
I have fond this great software, please read this article:
Coloring Your Code in vBulletin Posts
author : Yves Maurer
Environment: Visual Basic and Visual C++ forums on CodeGuru
Introduction
I wrote a small utility that allows you to do some basic syntax highlighting when pasting C++ or Visual Basic code into vBulletin groups, instead of using the ugly PHP codes.
-
Thats nice toysoldier good link :)
-
So you want to convert a something written in a dynamic programming language into a static markup page? WTF? Try a scripting language like PHP.
-
Ober I think the OP wanted some way to take his code and convert it to a syntax highlighed HTML
-
oops. Misread the situation.
-
well C++ is more programming, HTML is more "scripting" theyre not really related. C++ is used for software while HTML is for websites.
edit: nevermind i think what your trying to do is post c++ source onto a html website... right?
-
No, HTML is more "marking up". Hence the name.
JavaScript is more "scripting". Hence the name.