|
deprecated = something that is planned to be removed in the future
usually when you see that message, the compiler suggests am alternative call. (fopen_s is the replacement for fopen, i think)
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
is there a way to count words in a string the same as .GetLenght(hello) = 5 i need a way to count the words in a string = 11.
|
|
|
|
|
Words in a string means? Distinct number of words, separated by spaces? You can find out the number of spaces in your string and then add one to this count. It will be the number of words.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
loop through every character in the string and count the characters which separate words (white-space, punctuation, etc) . actually, it's probably easier if you just count the number of times a letter (or number?) comes after whitespace or punctuation.
Cleek | Image Toolkits | Thumbnail maker
-- modified at 7:49 Friday 7th July, 2006
|
|
|
|
|
|
Typically this problem is used in data structures courses. There are several different algorithms for it, but here is a fairly easy one:
- Split the string based on delimiters (spaces, punctuation) and place results in an array (vector or list works fine).
- Remove any null strings from the array.
- Return the count of the array.
There are more sophisticated algorithms for counting words that involve grammar checking ... but this algorithm is sufficiently fast for most cases.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i would but im new at this and have been reading about array's and im still lost as to how to make one add to it and get date back from it.
|
|
|
|
|
locoone wrote: i would but im new at this and have been reading about array's and im still lost as to how to make one add to it and get date back from it
An array can be as simple as declaring char buffer[1000] . I was using the term rather generically in that post. You would most likely want to use std::list or std::vector for this problem.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
i have no clue about them either as i said im new at this and msdn isnt much help.
|
|
|
|
|
locoone wrote: i have no clue about them either as i said im new at this and msdn isnt much help.
Bah! Shame on you! MSDN is perhaps one of the best documentation tools available ...
That said, if you are just beginning, you should stop trying to write code and go to Barnes and Noble to pick up a few intro to C/C++ books. Otherwise, I can offer suggestions on what to do all day and you won't understand a single word of it.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
well please do me a favor and find a page in msdn that show how to make and add data to an array i think to get it back its just name[1]; aint it?
|
|
|
|
|
Declaring an array is nothing more than this:
type name[size];
For example, an array of 100 characters called 'buffer' would be declared as follows:
char buffer[100];
You access individual elements in the array by the 0-based index, so accessing the first character is done by:
buffer[0] = 'a';
cout << buffer[0] << endl;
To access the last character, you would write:
buffer[99] = 'a';
cout << buffer[99] << endl;
And every other character can be accessed with indicies between 0 and 99.
Those are C-style arrays. C++ has classes called vector , list , stack , queue , deque , map , etc ... which are all different forms of "arrays" (here meaning "container of elements"). If you look up list or vector in MSDN, it will give you a list of methods as well as an example or two using them. If you want to know what they should be used for, get a book that explains them in detail (MSDN is a reference guide -- not a tutorial or beginner's manual).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
In Localization process of MFC application, Instead of writing satellite DLLs, using XML files as String resource is advisable ?
I think .NET is flexible to XML Resouce files. But how about MFC with XML Resource ?
Kindly suggest me.
Regards,
Karthik M
|
|
|
|
|
karthikoncodeproject wrote: But how about MFC with XML Resource ?
AFAIK you can load XML file as file resource, which you have to read using RESOURCE api using FindResourceEx and related function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks Gupta,
But i am keen to clarify that whether the XML resource can be used to supply string resource ? and it will be a optimal solution intead of satellite DLLs ?
People in localization process! kindly suggest me .
Regards,
Karthik M
|
|
|
|
|
karthikoncodeproject wrote: But i am keen to clarify that whether the XML resource can be used to supply string resource
Just by common sense, AFAIK there is no support for XML resource in MFC DLL.XML File can only be added as file resource, which you have to find and load at runtime by api's i had mentioned in my previous post.
karthikoncodeproject wrote: and it will be a optimal solution intead of satellite DLLs ?
Now as there is no support for XML file, you have to read that Resource in Some String Var, manually parse it and reterive the required Data from it now i believe you can compares for it speed and security with Satellite Dll, as there would be no security as provided by Satelite dll in MFC resource DLL.
karthikoncodeproject wrote: People in localization process! kindly suggest me .
There are very few people here who have worked on Localization process.. you have to repost this problem in http://www.codeproject.com/script/comments/forums.asp?forumid=3785[^] might be some one able to help you!..
[ot] if you are same Karthik from Zenith.. you can ask you query on my mobile number... it hasn't changed yet!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
In my application the user should open and modify some files.
Before enabling the "Save" button I've to check the selected
file security attributes in order to verify if the current
user has the "WRITE" or "FULL CONTROL" permission on the file.
I've found the GetFileSecurity function but I don't know
how to use it and how to go on.
Can someone help me ?
Thanks a lot!
|
|
|
|
|
ilgale wrote: I've found the GetFileSecurity function...
You might also be able to use GetSecurityInfo() or GetNamedSecurityInfo() for this. Googling for them should be your next step.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I m using eVC++......
my code is compiling perfectly but...linking problem is there with error....
LNK2001:Unresolved External Symbols.....
wot is the solution....
REgards
FRozen
|
|
|
|
|
not enough infor to solve this problem.
Huynhnb
.: Your success is also me :.
|
|
|
|
|
Wat type of problem is that.
Generally ,this kind of problem occurs when a programmer uses
a variable without initialisation
or
a function is used without the header file in which it is resides
or
using of static memeber functions and memeber variables improperly
this may behelp out u
Nagaraju
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
Hi all,
Some body shold Help me plz.
In vc++ ,i have an application in SDI.
IN which when I run the application,an Circle is created ON the Form.
again When I MOve to the Drawn Circle and Right Click the Mouse,
another circle must be created at some distance x,y.and a line drawn between
two circles.not only that when i move one circle in form the line should be maintained between two circles.
again when i right click newly created circle another circle mustbe creared and a line between them.
These is continious process.
Plz Help me
Thank u
Bye
|
|
|
|
|
help you do what? write the code for you??
Do you have a specific question
cje
|
|
|
|
|
Yes,
At presently Iam using CClientDC DeviceContst Class
and ScreenToClient() and ClientToScreen() Methods
but not able to reach my target.
I want Suggestions ,as well as any available Methods in VC++
Thank u
Nagraj
|
|
|
|