Thread: C libraries/syntax on C++

  1. #1
    Banned
    Join Date
    Apr 2015
    Posts
    596

    C libraries/syntax on C++

    Hi guys, can I use C syntaxt in C++? I mean for example can I use char* , strlen , etc as in C?

    I'm asking if C++ supports what C provides!

    thanks alot

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by laserlight View Post
    I will read it ! but a lil question I wasn't specified in my question and sorry for that.

    what I'm facing is hastable in my question and I'M programming it in C, so because there's need for hashtable, I will use C++ configuration for using hashtable library, and just for using hashtable ! nothing else.
    I don't want to use C++ inheritance bla bla .. just for hashtable that's already found ! (btw I know there's open source in C for using hashtable as explained ..but more easy to use already submitted library as found in C)

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    It can be done, but is a bad idea unless you are proficient in both C and C++, and unfortunately in my estimation you are proficient in neither, sorry. It would be better for you to just use a C library for your hash table. If you really want to use a C++ component, learn and use C++ properly.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by laserlight View Post
    It can be done, but is a bad idea unless you are proficient in both C and C++, and unfortunately in my estimation you are proficient in neither, sorry. It would be better for you to just use a C library for your hash table. If you really want to use a C++ component, learn and use C++ properly.
    but there's no C libaray like C++, in C much harder! I'm not allowed to use open source project .. for using hashtable in C

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Why aren't you allowed to use open source projects?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using libraries with c
    By errigour in forum C Programming
    Replies: 3
    Last Post: 07-01-2012, 06:24 PM
  2. Array Syntax Versus Pointer Syntax
    By LyTning94 in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2011, 10:56 AM
  3. So many libraries!
    By Epy in forum Game Programming
    Replies: 7
    Last Post: 12-10-2009, 05:33 PM
  4. Libraries
    By kiknewbie in forum C Programming
    Replies: 6
    Last Post: 02-01-2009, 01:37 AM
  5. AIM C Libraries
    By _Cl0wn_ in forum C Programming
    Replies: 0
    Last Post: 05-29-2003, 11:06 AM

Tags for this Thread