How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask ATLPROG Your Own Question

ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

To C expert: How to convert my C source code to standard C

Customer Question

To C expert: How to convert my C source code to standard C source code so that it includes only standard C header files? My C source coding includes "CB.h", which is not an ANSI C standard C header file. The following five header files are included.
#include
#include "CB.h"
#include
#include
#include
My C source code is 100% accurate as it compiles fine and creates the exe file using Microsoft Visual Studio 2015. Because of the "CB.h" header file, my C source coding mostly contains keywords starting with "_mb" (_mbprnt instead of printf) as shown in the following C code:
void main()
{
_mbsini(0);
_mbinidata(_mbdarray,116);
_mbsdim(&mnu_S,__mnu_S,9);
_mbindex = 0;
if (setjmp(_mbonj) == 0) goto final9;
setinit_I();
mainfa_I();
final9: if (_mbindex != -1)
if (setjmp(_mbxfile) == 0) _mbiend();
if (((errl() > 0) & _mbsneq(err(),NULL))) {
cls();
_mbprnt("cs.","There was an error with code ",err());
_mbprnt("ci.","Error on line",errl());
_mbprnt("ci.","Extended error code",errx());
inkey();
}
setstd_I();
stop();
}
Submitted: 3 months ago.
Category: Programming
Expert:  Steve replied 3 months ago.

Hi there, my name is***** is CB.h? Can you post that file? Also, is the code you posted the entire C program?

Customer: replied 3 months ago.
Thanks Steve. Here are CB.h and faom.c (complete code that compiles fine) as well as cb.inc and cb32.lib files.Please let me know if you want to look at any other file.
http://www.mediafire.com/file/iatogievhk2zvct/CB.h
http://www.mediafire.com/file/t84wf4feaartp8e/faom.C
http://www.mediafire.com/file/w7z4pm7ab87cx13/cb.inc
http://www.mediafire.com/file/d312198hbx08jhr/cb32.lib
Customer: replied 3 months ago.
Are you online?
Expert:  Steve replied 3 months ago.

Hi there. I've taken a look and it's a pretty big job to go through all that. I'm going to opt out and see if there is someone else who wants to help you. I can give you a few tips:

1) Normally what you would do is compile without the header file and then go reconcile anything that's unresolved.

2) PASCAL NEAR and FAR are not relevant and the compiler will map them to void. We use a flat memory model now in a single code segment.

Sorry I couldn't be of more help.

Customer: replied 3 months ago.
62;I've taken a look and it's a pretty big job to go through all that.I have a very short .c file for displaying just one line "Hello World.". Want to take a look at this small file instead of the one I sent to you?
Customer: replied 3 months ago.
http://www.mediafire.com/file/sutdz1p1ks5tzsp/hi.C
http://www.mediafire.com/file/a1i77gnt1gqodgo/hi.exe