Click here to Skip to main content
16,008,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CTreeview question Pin
Iain Clarke, Warrior Programmer30-Jun-08 2:20
Iain Clarke, Warrior Programmer30-Jun-08 2:20 
QuestionLNK2005 Error... Pin
Rizean29-Jun-08 13:52
Rizean29-Jun-08 13:52 
AnswerRe: LNK2005 Error... Pin
Stephen Hewitt29-Jun-08 15:14
Stephen Hewitt29-Jun-08 15:14 
GeneralRe: LNK2005 Error... Pin
Rizean29-Jun-08 15:24
Rizean29-Jun-08 15:24 
QuestionRe: LNK2005 Error... Pin
Mark Salsbery29-Jun-08 15:17
Mark Salsbery29-Jun-08 15:17 
AnswerRe: LNK2005 Error... Pin
Rizean29-Jun-08 15:45
Rizean29-Jun-08 15:45 
QuestionRe: LNK2005 Error... Pin
Mark Salsbery30-Jun-08 6:38
Mark Salsbery30-Jun-08 6:38 
AnswerRe: LNK2005 Error... Pin
Rizean30-Jun-08 13:54
Rizean30-Jun-08 13:54 
One of my instructors finally got back with me and explained to me what I was doing wrong. "flush_istream" was a function I created to deal with invalid user inputs to cin calls. The function is only five lines long and it is used by a number of other functions. I placed it in its own header files stream_flush.h, but because it was the only function and because it was so short I did not separate the definition and implementation, i.e. no stream_flush.cpp file. However, as you have probably already figured out this caused the error of it being defined multiable times. My instructor suggested I inline the function which did fix the problem, however I'm thinking it would be better to separate the definition and the implementation.

#ifndef STREAM_FLUSH_H
#define STREAM_FLUSH_H

#include <istream>

//blocking if no data in the stream
inline void flush_istream(std::istream& in)
{
    while(in.peak() != '\n')
        in.get();
}

#endif


Thanks all for your help. Being in Korea often leaves me sitting here for up to a day or more sometimes waiting for help. Just one of the challenges of being in the Air Force and going to school online.
QuestionWhy does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 9:30
tippex129-Jun-08 9:30 
QuestionRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery29-Jun-08 9:46
Mark Salsbery29-Jun-08 9:46 
AnswerRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 10:08
tippex129-Jun-08 10:08 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error [modified] Pin
Mark Salsbery29-Jun-08 10:15
Mark Salsbery29-Jun-08 10:15 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex129-Jun-08 11:29
tippex129-Jun-08 11:29 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery29-Jun-08 11:49
Mark Salsbery29-Jun-08 11:49 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
tippex11-Jul-08 3:27
tippex11-Jul-08 3:27 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Mark Salsbery1-Jul-08 6:35
Mark Salsbery1-Jul-08 6:35 
GeneralRe: Why does the line "delete [] player_data_array;" give a Debug Error Pin
Stephen Hewitt29-Jun-08 15:15
Stephen Hewitt29-Jun-08 15:15 
QuestionIssue with calling the MessageBox Windows API from a DLL Pin
jbf15429-Jun-08 8:19
jbf15429-Jun-08 8:19 
AnswerRe: Issue with calling the MessageBox Windows API from a DLL Pin
dave_mm04-Dec-08 10:03
dave_mm04-Dec-08 10:03 
GeneralRe: Issue with calling the MessageBox Windows API from a DLL Pin
jbf1544-Dec-08 16:23
jbf1544-Dec-08 16:23 
QuestionNetwork programming (problem)???my server software is giving connection established but my client software is giving socket init failed Pin
bodhi201629-Jun-08 6:25
bodhi201629-Jun-08 6:25 
AnswerRe: Network programming (problem)???my server software is giving connection established but my client software is giving socket init failed Pin
Mark Salsbery29-Jun-08 8:18
Mark Salsbery29-Jun-08 8:18 
QuestionNeed Help... Pin
Rozz1829-Jun-08 0:36
Rozz1829-Jun-08 0:36 
AnswerRe: Need Help... Pin
rp_suman29-Jun-08 5:00
rp_suman29-Jun-08 5:00 
AnswerRe: Need Help... Pin
Baltoro29-Jun-08 11:37
Baltoro29-Jun-08 11:37 

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.