go_away

Author Topic: Problem with simple eclipse program  (Read 530 times)

0 Members and 1 Guest are viewing this topic.

Offline vipulan12Topic starter

  • Robot Overlord
  • ****
  • Posts: 170
  • Helpful? 0
Problem with simple eclipse program
« on: February 16, 2013, 12:29:03 PM »
hey guys i am trying to learn c using eclipse and after installing the cygwin

I tried this program:

/*
 ============================================================================
 Name        : HelloworldC.c
 Author      :
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int pop=1;

int main(void)
{

   printf(pop);
   return EXIT_SUCCESS;
}

when i compile and run the program i get this error:

1 [main] HelloworldC 4692 exception::handle: Exception: STATUS_ACCESS_VIOLATION
830 [main] HelloworldC 4692 open_stackdumpfile: Dumping stack trace to HelloworldC.exe.stackdump



i don't know if my code is wrong or if i did something wrong with setting up the compiler(i looked through lots of tutorials to set it up)

Obviously I am a complete newbie so you have any suggestions try to explain it so that I could get it
I have done some Turing and ready to program Java but nothing super complicated
so please any advice is appreciated 

Offline briselec

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 1
Re: Problem with simple eclipse program
« Reply #1 on: February 16, 2013, 03:13:57 PM »
You should have got warnings when you compiled it because that's not how you use printf.
Should be -  printf("%d", pop);
In assembly language no one can hear you scream

Offline vipulan12Topic starter

  • Robot Overlord
  • ****
  • Posts: 170
  • Helpful? 0
Re: Problem with simple eclipse program
« Reply #2 on: February 16, 2013, 04:37:33 PM »
what is the %d for

Offline vipulan12Topic starter

  • Robot Overlord
  • ****
  • Posts: 170
  • Helpful? 0
Re: Problem with simple eclipse program
« Reply #3 on: February 16, 2013, 04:51:20 PM »
Thanks that made it work

 


Get Your Ad Here