BrainDump
  Home arrow BrainDump arrow Page 6 - C: Strings
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

C: Strings
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-03-03

    Table of Contents:
  • C: Strings
  • Storing Strings
  • String Operations
  • Strcat()
  • Strcmp()
  • Strcpy()

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    C: Strings - Strcpy()
    (Page 6 of 6 )

    To copy one string into another, use the strcpy_s() function. It works by placing the second string into the first:


    #include <stdio.h>

    #include <string.h>

    int main ()

    {

    char first[10];

    char second[10]="James";

    strcpy_s(first,second);

    printf(first);

    return(0);

    }

    The result of this program is:

      James

    While that isn't all of the string functions or ways that you can use strings in C, it should give you a good start. In our next article we will discuss how to use loops in C. So come back soon.

    Till then...


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Thanks for stopping by to read my article on C Strings. Here we discuss how to store...
     

    BRAINDUMP ARTICLES

    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager
    - Generating Clients and Services with Indigo
    - Vista SP1, A Review
    - Services and the WCF
    - VBScript: Final Date Functions
    - Creating Services with the WCF
    - The Resource View of the MFC
    - VBScript: More Fun with the Date Functions
    - Vista Price Cuts Dissected




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway