Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 35 guests and 1 member online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow code block program
EH-Net
May 22, 2013, 01:12:49 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: code block program  (Read 2786 times)
0 Members and 1 Guest are viewing this topic.
CTRLS
Newbie
*
Offline Offline

Posts: 25


View Profile
« on: July 25, 2011, 11:10:57 AM »

i really need some help right now....my computer isnt running the program that i programmed...as of right now im reading the Teach Yourself C in 21 days and i wrote my first source code it looks something like this

#include<stdio.h>

main()
{
     printf("Hello, World!"/n);
     return 0;
}

and i complie it and try to build and run it but it does nothing!!!!
can someone help me out
Logged
hell_razor
Jr. Member
**
Offline Offline

Posts: 90


View Profile
« Reply #1 on: July 25, 2011, 12:38:34 PM »

My C is crap...but shouldn't it be \n not /n ?
Logged

A+, Network+, Server+, CISSP, GSEC, GCIH, GPEN, GCIA, GISP, GCFW
CTRLS
Newbie
*
Offline Offline

Posts: 25


View Profile
« Reply #2 on: July 25, 2011, 12:39:17 PM »

hmm lemme try it out
Logged
CTRLS
Newbie
*
Offline Offline

Posts: 25


View Profile
« Reply #3 on: July 25, 2011, 12:40:27 PM »

it just tells me some bs that looks like this:

uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?!
Logged
hell_razor
Jr. Member
**
Offline Offline

Posts: 90


View Profile
« Reply #4 on: July 25, 2011, 12:46:48 PM »

Oh yeah, my bad....move the \n inside the quotes, too.

printf("Hello, World!\n");
Logged

A+, Network+, Server+, CISSP, GSEC, GCIH, GPEN, GCIA, GISP, GCFW
MaXe
Hero Member
*****
Offline Offline

Posts: 669


I've just upgraded myself to a cyborg muahahaa!!1


View Profile WWW
« Reply #5 on: July 25, 2011, 12:51:22 PM »

i really need some help right now....my computer isnt running the program that i programmed...as of right now im reading the Teach Yourself C in 21 days and i wrote my first source code it looks something like this

#include<stdio.h>

main()
{
     printf("Hello, World!"/n);
     return 0;
}

and i complie it and try to build and run it but it does nothing!!!!
can someone help me out

// Note the space between include and the header.
#include <stdio.h>

main()
{
     printf("Hello, World! \n");
     return 0;
}

It's been ages since I wrote C code, and if anything is wrong with that example, it would probably be the declaration of main() (In some languages you have to use "void" with main as well, but I'm noob so I forgot lol.)

Use Code::Blocks to compile the code as well, if you're on Windows. If you're on Linux, use "gcc". (e.g.: gcc sourcecode.c -o outputfilename )

After you've compiled the executable, if you're on linux, you may have to make it executable like this: chmod +x outputfilename
Logged

I'm an InterN0T'er
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.07 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Free Business and Tech Magazines and eBooks

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.