Important alert: (current site time 7/15/2013 5:56:49 PM EDT)
 

winzip icon

[ A simple string spliter ]

Email
Submitted on: 4/26/2005 1:37:48 PM
By: Gonzales Cenelia  
Level: Beginner
User Rating: By 1 Users
Compatibility: C++ (general)
Views: 19725
author picture
(About the author)
 
     This code split a given string into tokens.
 

INCLUDE files:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
//INCLUDE files for :[ A simple string spliter ]
//**************************************
#include <string.h>
#include <stdio.h>
#include <assert.h>
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 49 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/29/2005 6:06:41 PM

mersiiiiiiiiiiiiiiiiiiiii
(If this comment was disrespectful, please report it.)

 
6/16/2006 12:10:30 PMBob Simmons

It's not working on my compiler. I'm not sure if it's my compiler or if it's your program. I use Dev C++, which i got off Google, so it isn't exactly the best compiler.
(If this comment was disrespectful, please report it.)

 
6/16/2006 4:22:17 PMGonzales Cenelia

it should also work with Dev C++, you might get an error that said that the variable "j" is not declared in which case you will need to declare it before the "for loop" in the tokenize function

// current version
for(int i = 0, j = 0; str[i] != 0; ++i)
{

// after modification
int j = 0;
for(int i = 0; str[i] != 0; ++i)
{
(If this comment was disrespectful, please report it.)

 
9/7/2006 7:54:45 AMfarhan khan

about c++
(If this comment was disrespectful, please report it.)

 
12/6/2006 1:30:44 AMRitesh

Hi cenelia,

I am new to c++ programming can you help me to understand the code in details as I have never done tokenization of a string and I have no example in my Text Book as well!!!
I have also a homework on Tokenizing a text file contaning English sentence and put only 4 characters words in an array and sorting them alphabetically.

Thanks to help.
(If this comment was disrespectful, please report it.)

 
12/23/2010 1:30:27 PMAndré

Great share man. Keep it up !
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.