Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. strings in c++

strings in c++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
6 Posts 6 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pariisa
    wrote on last edited by
    #1

    hi I want write the code for : char *strcpy(char *s1 , const char *s2 )? char *strncpy(char *s1 , const char *s2 , int size)? char *strcat( char *s1 , const char *s2 )? char *strncat( char *s1 , const char *s2 , int size )? int *strcmp( const char *s1 , const char *s2 )? int *strncmp( const char *s1 , const char *s2 , int size)? help me please

    T P C S 4 Replies Last reply
    0
    • P pariisa

      hi I want write the code for : char *strcpy(char *s1 , const char *s2 )? char *strncpy(char *s1 , const char *s2 , int size)? char *strcat( char *s1 , const char *s2 )? char *strncat( char *s1 , const char *s2 , int size )? int *strcmp( const char *s1 , const char *s2 )? int *strncmp( const char *s1 , const char *s2 , int size)? help me please

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      what's your question exactly ? you want to rewrite thos function ? what for ? moreover, if you work with C++ strings, you'd better forget those old char*. they are a legacy from the C language, kept for compatibility. however, you should use the std::string class instead; which class proposes all the functionnality you want to redevelop here (if i get you well)


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      V 1 Reply Last reply
      0
      • P pariisa

        hi I want write the code for : char *strcpy(char *s1 , const char *s2 )? char *strncpy(char *s1 , const char *s2 , int size)? char *strcat( char *s1 , const char *s2 )? char *strncat( char *s1 , const char *s2 , int size )? int *strcmp( const char *s1 , const char *s2 )? int *strncmp( const char *s1 , const char *s2 , int size)? help me please

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        What exactly do you want ? Please be specific while posting. Regards, Paresh.

        1 Reply Last reply
        0
        • P pariisa

          hi I want write the code for : char *strcpy(char *s1 , const char *s2 )? char *strncpy(char *s1 , const char *s2 , int size)? char *strcat( char *s1 , const char *s2 )? char *strncat( char *s1 , const char *s2 , int size )? int *strcmp( const char *s1 , const char *s2 )? int *strncmp( const char *s1 , const char *s2 , int size)? help me please

          C Offline
          C Offline
          C Mahesh
          wrote on last edited by
          #4

          I think you should reffer to some good books on C and C++ (Ex: C and C++ Programmers Bible)

          1 Reply Last reply
          0
          • T toxcct

            what's your question exactly ? you want to rewrite thos function ? what for ? moreover, if you work with C++ strings, you'd better forget those old char*. they are a legacy from the C language, kept for compatibility. however, you should use the std::string class instead; which class proposes all the functionnality you want to redevelop here (if i get you well)


            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            V Offline
            V Offline
            vijay_aroli
            wrote on last edited by
            #5

            toxcct wrote:

            you want to rewrite thos function ?

            yes, i think he wants to rewrite those functions. :cool: and i also feel its part of an assignment/homework given to him.

            Regards, Vijay. God may not give us what we 'want', but he surely gives us what we 'need'.

            1 Reply Last reply
            0
            • P pariisa

              hi I want write the code for : char *strcpy(char *s1 , const char *s2 )? char *strncpy(char *s1 , const char *s2 , int size)? char *strcat( char *s1 , const char *s2 )? char *strncat( char *s1 , const char *s2 , int size )? int *strcmp( const char *s1 , const char *s2 )? int *strncmp( const char *s1 , const char *s2 , int size)? help me please

              S Offline
              S Offline
              Stephen Hewitt
              wrote on last edited by
              #6

              You shouldn't be using these low level and old fashioned string manipulations routines without a compelling reason to do so. Instead use a string class such as the standard library's std::string or MFC's CString.

              Steve

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups