Thread: C for Visual Studio

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    16

    C for Visual Studio

    Hi, can someone help me get started on writing a C, not C++ application in Visual Studio. What setting do I need to set and what code (ie, precompilers) need to be put in the file? A nice tutorial link would be great. Thanks Mucho. George

  2. #2
    Registered User
    Join Date
    Sep 2005
    Posts
    16

    Substring functions

    Hi, can someone help me with functions that do substring, left and right cuts from a string.

    examples:
    Code:
    string = "cprogramming"
    
    right(string,1) = "c"
    left(string,4) = "ming"
    substring(string,3,4) = "og"
    thanks

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    16

    mistake

    I got my rights and lefts backwards, sorry.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    with VC++ 6.0, all you have to do is name the file with a *.c extension, then turn off precompiled headers (they can't be used with C). you can even mix *.c and *.cpp in the same project and the compiler will compile them appropriately. Turn off precompiled headers, select menu item Projects --> Settings, then select c++ tab in the dialog box. Change "Category" combobox to "Precompiled Headers" and hit the Not Using Precompiled Headers radio button.

    you have to write your own left, right and substr functions. Isn't very difficult, and will give you good practice improving your C language skills.
    Last edited by Ancient Dragon; 10-01-2005 at 04:47 AM.

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    VB programmers stand out like a sore thumb

  6. #6
    Registered User
    Join Date
    Sep 2005
    Posts
    16
    You're right sand_man, what was i thinking using that junk, VB made me a bad programmer. by the way, it worked Ancient Dragon, much thanks.

  7. #7
    Registered User
    Join Date
    Nov 2007
    Posts
    6
    why do you call it junk?

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    This thread is 2 years old - see the rules, don't bump dead threads.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM