<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Starttipp Blog &#187; cgi-bin</title>
	<atom:link href="http://starttipp.de/tag/cgi-bin/feed/" rel="self" type="application/rss+xml" />
	<link>http://starttipp.de</link>
	<description>Blog von Webmastern für Webmaster</description>
	<lastBuildDate>Mon, 07 Jun 2010 01:34:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hallo Welt in C/C++ f&#252;r CGI</title>
		<link>http://starttipp.de/linux/hallo-welt-in-cc-fuer-cgi/</link>
		<comments>http://starttipp.de/linux/hallo-welt-in-cc-fuer-cgi/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 15:39:57 +0000</pubDate>
		<dc:creator>Redaktion</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[cgi-bin]]></category>

		<guid isPermaLink="false">http://starttipp.de/?p=298</guid>
		<description><![CDATA[Vor einigen Tagen fragte mich ein Kunde, ob man denn statt Perl im /cgi-bin Verzeichnis auch C/C++ einsetzen k&#246;nne. Das ist kein Problem, wie unser kleines Beispiel hier zeigt.

CGI (Common Gateway Interface) Scripte werden oftmals gleichgesetzt mit der Verwendung von Perl als Scriptsprache. Das ist aber nicht ganz korrekt, es lassen sich auch andere Programmier- [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://starttipp.de/wp-content/uploads/2010/06/code_ico.jpg"><img src="http://starttipp.de/index.php?feedimage=wp-content/uploads/2010/06/code_ico.jpg" alt="" title="code_ico" width="100" height="100" class="alignleft size-full wp-image-311" /></a>Vor einigen Tagen fragte mich ein Kunde, ob man denn statt Perl im /cgi-bin Verzeichnis auch C/C++ einsetzen k&#246;nne. Das ist kein Problem, wie unser kleines Beispiel hier zeigt.</p>
<p><span id="more-298"></span></p>
<p>CGI (Common Gateway Interface) Scripte werden oftmals gleichgesetzt mit der Verwendung von Perl als Scriptsprache. Das ist aber nicht ganz korrekt, es lassen sich auch andere Programmier- oder Scriptsprachen verwenden. So wie zum Beispiel die durch den Kunden angefragte Programmiersprache C/C++</p>
<p>Ein typisches &#8220;Hallo Welt&#8221; Beispiel sieht dann so aus</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include </span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Content-Type: text/plain;charset=utf-8<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Hallo Welt<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dies peichert man entsprechend in der Datei hallo.c ab. &#220;blicherweise m&#252;ssen C/C++ Pgramme noch &#252;bersetzt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">g++</span> hallo.c <span style="color: #660033;">-o</span> hallo.cgi</pre></div></div>

<p>Das dann im Ordner /cgi-bin abgelegte hallo.cgi kann dann entsprechend aufgerufen werden und gibt &#8220;Hallo Welt&#8221; aus.</p>
<p>Vielleicht als kleine Anregung, auch einmal neuen Sprachen gegen&#252;ber offen zu sein <img src='http://starttipp.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://starttipp.de/linux/hallo-welt-in-cc-fuer-cgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

