Jump to content

Cygwin Help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
21 replies to this topic

#1
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
I am doing a school assignment that is very basic and only requires to install CYGWIN and use the following code to compile and run yet it shows errors.. I've written it EXACTLY how it was in the book so what am I doing wrong?
Here is the code:
#include <stdio.h>


main ()
{
 

printf(*\nC you later\n*);


} 

Edited by big-tony, 13 April 2009 - 11:30 PM.


#2
FrozenSnake

FrozenSnake

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
It's " not * ;)
#include <stdio.h>
main ()
{
	printf("\nC you later\n");
}


#3
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
hmm that's weird .. I wonder why they used * in the book ?

#4
FrozenSnake

FrozenSnake

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
Whats the name of the book?
It can be a early print with typos :)

#5
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
C Programming For the Absolute Beginner Second Edition.
Edit: I'm a complete idiot.. I looked back in my book very closely and it IS quotation marks and not an astrophie..lol I guess it was just too early in the morning and the book was too far away. It did look like a * though from a distance lol

#6
FrozenSnake

FrozenSnake

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
Haha, well now you know ;)

#7
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
ok so now i've compiled the "program" isn't it supposed to pop up a message box with my text? because all it does when i click on it is pops up a cmd box super quick then exits and i see nothing

#8
Phoenixz

Phoenixz

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 256 posts
Add in getchar(); after the printf so it doesn't exit straight away
Posted Image

#9
MerakSpielman

MerakSpielman

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
Honestly this is the sort of thing that professional editors are supposed to catch - you'll notice that most programming books use a different font for their text and their code. The text font is designed for fast, easy reading and the code font is designed to reduce errors by making each character clear and identifiable even at a casual glance.

Sorry I worked as a tech editor for 4 years so these things kind of bug me. :P

#10
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
What am I doing wrong? This is driving me crazy! I have till the end of this week to figure this CYGWIN out because I have homework,teamwork etc to get done.:blink:
Screen shot is below. Just take out the "xx" in hxxp Since I can't post links yet.
hxxp://img254.imageshack.us/img254/6350/58458471.jpg

#11
FrozenSnake

FrozenSnake

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
Try add a ; after printf("\nC you later\n") ;)
#include <stdio.h>

int main()
{
	printf("\nC you later\n");
	return 0;
}


#12
big-tony

big-tony

    Learning Programmer

  • Members
  • PipPipPip
  • 42 posts
I still get the same error. syntax error near expected token '$'\r'' :(
I was reading up on it and I think it has something to do with Windows and line break carriage returns etc being different in unix or something to that extent but I have no clue about programming and this is SUPPOSE to be a "basic" intro to programming since my major is Web Design.