Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Experiencing trouble with passing input string to array Pin
Luc Pattyn20-May-10 15:48
sitebuilderLuc Pattyn20-May-10 15:48 
GeneralRe: Experiencing trouble with passing input string to array Pin
computerpublic20-May-10 15:59
computerpublic20-May-10 15:59 
AnswerRe: Experiencing trouble with passing input string to array Pin
Luc Pattyn20-May-10 16:00
sitebuilderLuc Pattyn20-May-10 16:00 
GeneralRe: Experiencing trouble with passing input string to array Pin
computerpublic20-May-10 16:06
computerpublic20-May-10 16:06 
GeneralRe: Experiencing trouble with passing input string to array Pin
Luc Pattyn20-May-10 16:39
sitebuilderLuc Pattyn20-May-10 16:39 
GeneralRe: Experiencing trouble with passing input string to array Pin
computerpublic20-May-10 16:55
computerpublic20-May-10 16:55 
GeneralRe: Experiencing trouble with passing input string to array Pin
Aescleal20-May-10 22:21
Aescleal20-May-10 22:21 
AnswerRe: Experiencing trouble with passing input string to array Pin
Aescleal20-May-10 20:06
Aescleal20-May-10 20:06 
I have to say it was a bit of a trial reading your code, not just 'cause of the formatting! Before slagging people off for their attitude in helping you remember it pays to give them the respect they deserve by posting code that actually compiles - as you couldn't be bothered to stick you code in
 tags we can't see your include files for example. Also some idea of what the program does is helpful when it's not obvious from the code (and in this case it aint obvious - are you trying to count the lines that start with A or a or just echo a file to the console?)

Look into these things:

 - Don't use low level constructs (pointer, arrays, dynamic memory allocation) where a couple of local objects would have done (i.e. use <code>std::vector<std::string> lines( number_of_lines );</code> )
 - use variable names that describe what you're doing - i.e. rename adder and A
 - Learn how IOStreams work - <code>cin >> fileName;</code> won't work if you have spaces in the filename
 - Grab a textbook and have a look at the difference between initialisation and assignment. For example there's no reason to not create your input file object and open it at the same time
 - using strlen is completely pointless in a C++ program that's using std::string. Look up the interface to std::string in a decent reference and you'll find a member that does the right thing

Cheers,

Ash

AnswerRe: it works perfectly now [modified] Pin
Software_Developer20-May-10 20:08
Software_Developer20-May-10 20:08 
GeneralRe: it works perfectly now Pin
Aescleal20-May-10 22:17
Aescleal20-May-10 22:17 
GeneralRe: You must be the Quality assurance team Pin
Software_Developer20-May-10 23:31
Software_Developer20-May-10 23:31 
QuestionHow to set breakpoint to step through CTabCtrl draw ... [modified] Pin
theFrenchHornet20-May-10 11:45
theFrenchHornet20-May-10 11:45 
Questionc++ combo list box Pin
mrby12320-May-10 5:55
mrby12320-May-10 5:55 
QuestionRe: c++ combo list box Pin
David Crow20-May-10 6:13
David Crow20-May-10 6:13 
AnswerRe: c++ combo list box Pin
mrby12320-May-10 6:25
mrby12320-May-10 6:25 
AnswerRe: c++ combo list box Pin
David Crow20-May-10 6:55
David Crow20-May-10 6:55 
GeneralRe: c++ combo list box Pin
mrby12320-May-10 9:58
mrby12320-May-10 9:58 
AnswerRe: c++ combo list box Pin
David Crow20-May-10 10:22
David Crow20-May-10 10:22 
GeneralRe: c++ combo list box Pin
mrby12320-May-10 12:23
mrby12320-May-10 12:23 
AnswerRe: c++ combo list box Pin
David Crow20-May-10 16:25
David Crow20-May-10 16:25 
GeneralRe: c++ combo list box [modified] Pin
mrby12320-May-10 18:54
mrby12320-May-10 18:54 
GeneralRe: c++ combo list box Pin
David Crow21-May-10 3:17
David Crow21-May-10 3:17 
QuestionCFile::Remove fails [Resolved] Pin
Mike Osbahr20-May-10 5:31
Mike Osbahr20-May-10 5:31 
AnswerRe: CFile::Remove fails Pin
jeron120-May-10 5:42
jeron120-May-10 5:42 
GeneralRe: CFile::Remove fails Pin
Mike Osbahr20-May-10 6:42
Mike Osbahr20-May-10 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.