Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   PeachParts Mercedes-Benz Forum > General Discussions > Off-Topic Discussion

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 01-12-2010, 11:00 AM
TheDon's Avatar
Ghost of Diesels Past
 
Join Date: Oct 2005
Posts: 13,285
anyone know C?

if you know C programming language I need a little help. My first assignment was to code "Hello World" and modify it to use for the first assignment. It compiled and ran fine but the text runs right into the "press any key to continue" script in DOS when that script should be below it. Visually its annoying.
Reply With Quote
  #2  
Old 01-12-2010, 11:02 AM
Crazy_Nate's Avatar
Registered User
 
Join Date: Jan 2008
Location: Hampton Roads
Posts: 567
You need a line return (think "enter" in a typical text interface).

In C, it's done with a "\n ", I believe.
__________________
1982 240D, sold 9/17/2008
1987 300D Turbo
W124.133 - 603.960, 722.317 - Smoke Silver Metallic / Medium Red (702/177), acquired 8/15/2009
262,715 and counting
Reply With Quote
  #3  
Old 01-12-2010, 11:08 AM
TheDon's Avatar
Ghost of Diesels Past
 
Join Date: Oct 2005
Posts: 13,285
yep that did the trick

thanks!
Reply With Quote
  #4  
Old 01-12-2010, 11:09 AM
JollyRoger's Avatar
Registered User
 
Join Date: Jul 2007
Posts: 48
You can handle it in DOS by inserting the word "echo" above the pause statement, that will give you a new line.

You should post your code if you want help, given the information you gave, I am guessing you are missing a carriage return/line feed escape code at the end of your output statement. That will depend on the paltform:

On Unix, an ASCII newline (\n) LF (linefeed) character ends each line.

On Windows, an ASCII sequence CR LF (\r\n) (return followed by linefeed) ends each line.

On Macintosh, an ASCII CR (\r) (carriage return) character ends each line.
Reply With Quote
  #5  
Old 01-12-2010, 11:28 AM
TheDon's Avatar
Ghost of Diesels Past
 
Join Date: Oct 2005
Posts: 13,285
Quote:
Originally Posted by JollyRoger View Post
You can handle it in DOS by inserting the word "echo" above the pause statement, that will give you a new line.

You should post your code if you want help, given the information you gave, I am guessing you are missing a carriage return/line feed escape code at the end of your output statement. That will depend on the paltform:

On Unix, an ASCII newline (\n) LF (linefeed) character ends each line.

On Windows, an ASCII sequence CR LF (\r\n) (return followed by linefeed) ends each line.

On Macintosh, an ASCII CR (\r) (carriage return) character ends each line.
thanks!

but Nate hit it on the head and it worked out for me
Reply With Quote
  #6  
Old 01-12-2010, 11:50 AM
JollyRoger's Avatar
Registered User
 
Join Date: Jul 2007
Posts: 48
Quote:
Originally Posted by TheDon View Post
thanks!

but Nate hit it on the head and it worked out for me
You're not really wasting time on the old C, are you ? C# is where it is at, junk that $hit.
Reply With Quote
  #7  
Old 01-13-2010, 01:59 PM
89 300E
 
Join Date: May 2008
Location: Long Island, NY
Posts: 80
Quote:
Originally Posted by JollyRoger View Post
You can handle it in DOS by inserting the word "echo" above the pause statement, that will give you a new line.

You should post your code if you want help, given the information you gave, I am guessing you are missing a carriage return/line feed escape code at the end of your output statement. That will depend on the paltform:

On Unix, an ASCII newline (\n) LF (linefeed) character ends each line.

On Windows, an ASCII sequence CR LF (\r\n) (return followed by linefeed) ends each line.

On Macintosh, an ASCII CR (\r) (carriage return) character ends each line.
Hate to be a nit picker [I'm no longer on the ANSI C++ Committee], but the \r line separator was only for ancient Macs [System 7 and older], later Macs adopted the UNIX \n convention [but tolerate \r so they can read old files]

In current C standard output libraries [ #include ], you usually just specify a newline '\n' and the appropriate sequence is automagicly written to the output.
Reply With Quote
  #8  
Old 01-13-2010, 02:17 PM
JollyRoger's Avatar
Registered User
 
Join Date: Jul 2007
Posts: 48
I will record that somewhere in my diary.
Reply With Quote
  #9  
Old 01-12-2010, 11:10 AM
Craig
Guest
 
Posts: n/a
Sorry, I'm an old guy. Need any help with fortran77?
Reply With Quote
  #10  
Old 01-12-2010, 11:31 AM
1990 500SL
 
Join Date: Oct 2003
Location: Hawthorn Woods, IL. USA
Posts: 329
Quote:
Originally Posted by Craig View Post
Sorry, I'm an old guy. Need any help with fortran77?
Join the club, Fortran, Fortran IV, COBOL (not II, I know current but started on COBOL).

How about AutoCoder geesh dating myself.

Pick a language I've used it some.
__________________
KLK, MCSE

1990 500SL

I was always taught to respect my elders.
I don't have to respect too many people anymore.
Reply With Quote
  #11  
Old 01-12-2010, 11:48 AM
JollyRoger's Avatar
Registered User
 
Join Date: Jul 2007
Posts: 48
I miss Dbase II. Life was so much simpler then, when all's I needed was a "Clipper" lib.
Reply With Quote
  #12  
Old 01-12-2010, 11:12 AM
Crazy_Nate's Avatar
Registered User
 
Join Date: Jan 2008
Location: Hampton Roads
Posts: 567
Haha, good deal

I don't actually use C, I just use Matlab all the time and the fprintf and similar commands have all the same syntax
__________________
1982 240D, sold 9/17/2008
1987 300D Turbo
W124.133 - 603.960, 722.317 - Smoke Silver Metallic / Medium Red (702/177), acquired 8/15/2009
262,715 and counting
Reply With Quote
  #13  
Old 01-12-2010, 12:14 PM
TheDon's Avatar
Ghost of Diesels Past
 
Join Date: Oct 2005
Posts: 13,285
its C then C++... gotta get the basics first
Reply With Quote
  #14  
Old 01-12-2010, 01:56 PM
stimpy451's Avatar
Registered User
 
Join Date: Oct 2009
Location: Stubblefield Research Facility
Posts: 244
gcc, perl, java and am a little rusty with PASCAL

fu pascal
__________________

1972 W115 220D/8 SLS, Coffman Starter "Ümläüt"

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination
Reply With Quote
  #15  
Old 01-12-2010, 02:16 PM
JollyRoger's Avatar
Registered User
 
Join Date: Jul 2007
Posts: 48
pascal is so "over".
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:39 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2024 Pelican Parts, LLC - Posts may be archived for display on the Peach Parts or Pelican Parts Website -    DMCA Registered Agent Contact Page