![]() |
|
#1
|
|||
|
|||
Write two strlen (string length) functionsI am writing a program where i write two strlen(string length) functions. The first version of the program should use array subscripting, and the second version should use pointers and pointer arithmetic. This is what i have so far;
CPP / C++ / C Code:
Need help!!! thanks. Last edited by admin : 09-Sep-2009 at 14:48.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: Need help with this programHere is a hint:
The end of a string is the '\0' character. So, you could look at the first character and, if not equal to '\0', increment the count and go repeat on the next character. |
|
#3
|
||||
|
||||
Re: Need help with this programQuote:
I don't know what the "code" you've submitted is supposed to be, but it isn't anything useful. Perhaps...?: CPP / C++ / C Code:
...would it KILL YOU to read the guidelines?! MxB |
|
#4
|
|||
|
|||
Re: Need help with this programMexican Bob - Where were you at when I was in school?
|
|
#5
|
||||
|
||||
Re: Need help with this programQuote:
It depends...when were you in school? MxB |
|
#6
|
|||
|
|||
Re: Write two strlen (string length) functionsI use C#:
C-SHARP / C# Code:
|
|
#7
|
||||
|
||||
Re: Write two strlen (string length) functionsQuote:
That is incredibly unfortunate for you, particularly since this is a C++ forum, but apparently you are incapable of reading the requirements OR the guidelines. The requirements state TWO functions. One that uses an array and the other that uses pointers. Are you still working on the pointer version? bool winnt_chinese=true; winnt_chinese=("中国".Length ==2); if(winnt_chinese) ...so when is winnt_chinese not true? Your coding style needs attention. It is inconsistent and sloppy. Was it your intention to write a recursive function? Is the intention to support double byte character sets? Quote:
...is that even a valid statement? If that is valid code in C#, you can HAVE it...but PLEASE take it far, far away! How about back to "中国?" MxB |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Equation solver | RazoR | C Programming Language | 3 | 18-May-2008 09:24 |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 10:13 |
| BOOKEEPING program, HELP!! | yabud | C Programming Language | 10 | 17-Nov-2006 03:48 |
| Help with a complex program | lordfuoco | C++ Forum | 5 | 24-Jun-2006 06:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The