How can I switch?

This is a discussion on How can I switch? within the C++ Programming forums, part of the General Programming Boards category; I have borland C++ builder 4, is there a way it can be set to program,compile, link and debug in ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    2

    How can I switch?

    I have borland C++ builder 4, is there a way it can be set to program,compile, link and debug in C?

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,740
    I was frustrated by this also while using Borland. The strictest answer is no. I solved the problem by just downloading a C compiler, and now the majority of what I do is in C.

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    I have never used borland, but this is a complete guess, when you have to compile the programs, does it say .cpp under the file name? If so, change that to .c and the compiler "should" act on it as C code. I am only guessing and others might give you a better answer. But I use DevC++ and MSVC++ and this method works fine on them, although I do not write C programs anymore, only C++

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Well, if you use GCC/MinGW/Dev-C++, the compiler will guess C/C++ from the file extension. I'm not sure if it's the same with Borland.

    Make sure your source ends in .c. Try looking up some Borland documentation to see if there are any settings you should tweak. If you really want to stick to Borland like a captain to a boat, well...
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. ascii rpg help
    By aaron11193 in forum C Programming
    Replies: 18
    Last Post: 10-29-2006, 01:45 AM
  3. Switch
    By cogeek in forum C Programming
    Replies: 4
    Last Post: 12-23-2004, 05:40 PM
  4. Switch Case
    By FromHolland in forum C++ Programming
    Replies: 7
    Last Post: 06-13-2003, 03:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21