Click here to Skip to main content
16,016,770 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: String Parsing in C++ (Simple Question) Pin
vipin_nvk7-Jul-09 19:05
vipin_nvk7-Jul-09 19:05 
GeneralRe: String Parsing in C++ (Simple Question) Pin
ksaw1237-Jul-09 19:19
ksaw1237-Jul-09 19:19 
GeneralRe: String Parsing in C++ (Simple Question) Pin
Chandrasekharan P7-Jul-09 19:27
Chandrasekharan P7-Jul-09 19:27 
GeneralRe: String Parsing in C++ (Simple Question) Pin
N a v a n e e t h7-Jul-09 20:19
N a v a n e e t h7-Jul-09 20:19 
AnswerRe: String Parsing in C++ (Simple Question) Pin
PrafullaVedante7-Jul-09 20:25
PrafullaVedante7-Jul-09 20:25 
AnswerRe: String Parsing in C++ (Simple Question) Pin
chandu0047-Jul-09 20:26
chandu0047-Jul-09 20:26 
AnswerRe: String Parsing in C++ (Simple Question) Pin
CPallini7-Jul-09 21:17
mveCPallini7-Jul-09 21:17 
AnswerRe: String Parsing in C++ (Simple Question) Pin
Stuart Dootson7-Jul-09 21:31
professionalStuart Dootson7-Jul-09 21:31 
If you want simple hack, then

std::string s = "/work1/data/xxxx/yyy/file_name.txt";

std::string::size_type lastSep = s.find_last_of('/');
if (lastSep != std::string::npos)
   s.erase(lastSep);



If you want a nice cross-platform for manipulating file paths, I'll recommend Boost.FileSystem[^], where you can do this:

boost::filesystem::path justThePath("/work1/data/xxxx/yyy/file_name.txt");
justThePath.remove_filename();


Oh - and it'll happily deal with Windows vs Unix path conventions.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionRe: String Parsing in C++ (Simple Question) Pin
David Crow8-Jul-09 2:51
David Crow8-Jul-09 2:51 
QuestionMaximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman877-Jul-09 12:20
clayman877-Jul-09 12:20 
QuestionRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
harold aptroot7-Jul-09 15:28
harold aptroot7-Jul-09 15:28 
AnswerRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? [modified] Pin
clayman877-Jul-09 15:53
clayman877-Jul-09 15:53 
AnswerRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
Adam Roderick J7-Jul-09 18:29
Adam Roderick J7-Jul-09 18:29 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman877-Jul-09 18:48
clayman877-Jul-09 18:48 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
Adam Roderick J7-Jul-09 20:42
Adam Roderick J7-Jul-09 20:42 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman877-Jul-09 21:27
clayman877-Jul-09 21:27 
AnswerRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
killabyte7-Jul-09 19:07
killabyte7-Jul-09 19:07 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman877-Jul-09 19:50
clayman877-Jul-09 19:50 
AnswerRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
David Crow8-Jul-09 2:55
David Crow8-Jul-09 2:55 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman878-Jul-09 4:24
clayman878-Jul-09 4:24 
AnswerRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
Moak4-Aug-09 1:15
Moak4-Aug-09 1:15 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman874-Aug-09 2:27
clayman874-Aug-09 2:27 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
Moak4-Aug-09 5:29
Moak4-Aug-09 5:29 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
clayman874-Aug-09 5:37
clayman874-Aug-09 5:37 
GeneralRe: Maximum UDP transmit rate is just 50 MB/s and with 100% CPU usage!?? Pin
Moak4-Aug-09 5:46
Moak4-Aug-09 5:46 

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.