Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-2008, 04:08 PM
Anirban Chakraborty's Avatar   
Anirban Chakraborty Anirban Chakraborty is offline
Learning Programmer
 
Join Date: Oct 2006
Location: India
Posts: 50
Rep Power: 8
Anirban Chakraborty will become famous soon enough
Default Problem With BCC32

This C program attachment works well with GNU C compiler ie. The output midi file works when played. But it doesn't work with Borland C compiler.
Attached Files
File Type: c HEX2CHAR.C (1.1 KB, 6 views)
File Type: txt 1.txt (7.4 KB, 4 views)
__________________
Anirban Chakraborty
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-13-2008, 06:19 PM
MeTh0Dz MeTh0Dz is offline
SLICE OWNZ YOUR SOUL
 
Join Date: May 2008
Posts: 294
Last Blog:
Ternary Operator CPP
Rep Power: 0
MeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura about
Default Re: Problem With BCC32

It's just because Borland sucks. Your code is probably fine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-13-2008, 09:47 PM
Aereshaa's Avatar   
Aereshaa Aereshaa is offline
Guru
 
Join Date: Apr 2008
Posts: 539
Rep Power: 9
Aereshaa is a jewel in the roughAereshaa is a jewel in the roughAereshaa is a jewel in the roughAereshaa is a jewel in the rough
Default Re: Problem With BCC32

@Methodz: *Applause*
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-13-2008, 10:37 PM
MeTh0Dz MeTh0Dz is offline
SLICE OWNZ YOUR SOUL
 
Join Date: May 2008
Posts: 294
Last Blog:
Ternary Operator CPP
Rep Power: 0
MeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura aboutMeTh0Dz has a spectacular aura about
Default Re: Problem With BCC32

LOL, thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-14-2008, 11:16 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Problem With BCC32

Microsoft Visual C++ 2008 Express Edition

Good IDE for free from Microsoft.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-15-2008, 12:35 AM
Aereshaa's Avatar   
Aereshaa Aereshaa is offline
Guru
 
Join Date: Apr 2008
Posts: 539
Rep Power: 9
Aereshaa is a jewel in the roughAereshaa is a jewel in the roughAereshaa is a jewel in the roughAereshaa is a jewel in the rough
Default Re: Problem With BCC32

Quote:
It should. Microsoft Visual Studio 2008 Express Edition (Visual Studio 2008 Express Edition Products) provides a C/C++ IDE and compiler for free. (Scroll down a bit to find the C/C++ one.)
Quote:
There's a newer version available for download on Microsoft's website (free):
Microsoft Visual Studio 2008 (Visual Studio 2008 Express Edition Products)
@^: What, are you Microsoft's spokesman? Come on, not everyone runs windows, or needs an all-in-one ide that wastes memory, doesn't optimize well, and doesn't conform to C or C++ standards.
All you ever need is gcc and the editor of your choice be it vi, emacs, nano, notepad++, PSpad, etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-15-2008, 09:06 AM
Oigen Oigen is offline
Learning Programmer
 
Join Date: Jul 2008
Posts: 40
Rep Power: 2
Oigen is on a distinguished road
Default Re: Problem With BCC32

He he he, windows representative, giving a sales pitch . But seriously now, it's probably because of Borland.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-15-2008, 02:24 PM
dcs dcs is offline
Programming Expert
 
Join Date: Mar 2008
Posts: 371
Rep Power: 6
dcs has a spectacular aura aboutdcs has a spectacular aura about
Default Re: Problem With BCC32

I built your code with both.
Quote:
Comparing files borland.mid and GCC.MID
FC: no differences encountered
Code:
	while(!feof(fpin)){
Cprogramming.com: FAQ


But I think this may be your problem:
Code:
	fpout = fopen("1.mid", "wb");
On windows you'll definitely want to open the output file in binary mode to avoid newline translations.

You could really shorten this to
Code:
#include <stdio.h>

int main()
{
   FILE *fpin  = fopen("1.txt", "r");
   FILE *fpout = fopen("1.mid", "wb");
   if ( fpin && fpout )
   {
      unsigned int hex;
      while ( fscanf(fpin, "%2x", &hex) == 1 )
      {
         fputc(hex, fpout);
      }
      fclose(fpin);
      fclose(fpout);
   }
   return 0;
}

Last edited by dcs; 07-15-2008 at 02:41 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-15-2008, 10:30 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Problem With BCC32

Is it wrong of me to promote a product that I find quite useful? I dislike Windows's buggyness, but they make some good stuff. (I like free things.)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 08:46 AM
Problem read pwd protected Access2K dbase - CR9 & VB6 mrbar Visual Basic Programming 2 03-10-2008 05:50 AM
How to tackle a programming problem? TcM General Programming 10 01-07-2008 12:29 PM
i have a problem please help me!!!???? stack Java Help 8 09-22-2007 04:17 PM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 05:58 AM


All times are GMT -5. The time now is 10:43 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 101%


Complete - Celebrate!

Ads