Advertisement
Advertisement
| 01.31.2008 at 12:10PM PST, ID: 23127623 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 01.31.2008 at 12:16PM PST, ID: 20790555 |
| 01.31.2008 at 12:21PM PST, ID: 20790602 |
| 01.31.2008 at 12:22PM PST, ID: 20790608 |
| 01.31.2008 at 12:22PM PST, ID: 20790618 |
| 01.31.2008 at 12:24PM PST, ID: 20790640 |
| 01.31.2008 at 12:25PM PST, ID: 20790647 |
| 01.31.2008 at 12:26PM PST, ID: 20790659 |
| 01.31.2008 at 12:30PM PST, ID: 20790710 |
| 01.31.2008 at 12:32PM PST, ID: 20790724 |
| 02.01.2008 at 02:46PM PST, ID: 20801451 |
| 02.06.2008 at 06:07AM PST, ID: 20831958 |
| 02.14.2008 at 07:14AM PST, ID: 20893917 |
| 02.14.2008 at 07:26AM PST, ID: 20894041 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: |
#include <string>
#ifdef _WIN32
#define PATH_DELIM '\\'
#else
#define PATH_DELIM '/'
#endif
int main()
{
std::string sPath = "c:\\dir\\app1 ";
std::string::size_type pos = sPath.rfind(PATH_DELIM);
if(sPath.size() > 1 && pos != std::string::npos) { sPath = sPath.substr(pos + 1); }
return 0;
}
|
| 02.18.2008 at 02:22AM PST, ID: 20918805 |
| 02.18.2008 at 02:38AM PST, ID: 20918855 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#define PATH_DELIM "\\"
#else
#define PATH_DELIM "/"
#endif
void strip_path(char * szPath)
{
char const * curpos = strtok(szPath, PATH_DELIM);
char const * pos = NULL;
while(curpos = strtok(NULL, PATH_DELIM)) { pos = curpos; }
if(pos) { strcpy(szPath, pos); }
}
int main()
{
char szPath1[] = "c:\\dir\\app1 ";
char szPath2[] = "app1 ";
strip_path(szPath1);
printf("Path1: %s\n", szPath1);
strip_path(szPath2);
printf("Path2: %s\n", szPath2);
return 0;
}
|
| 02.18.2008 at 02:58AM PST, ID: 20918906 |
| 02.18.2008 at 03:07AM PST, ID: 20918941 |
| 02.18.2008 at 03:10AM PST, ID: 20918947 |
| 02.18.2008 at 03:11AM PST, ID: 20918954 |
| 02.18.2008 at 03:19AM PST, ID: 20918987 |
| 02.18.2008 at 03:25AM PST, ID: 20919000 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: |
/* Return the basename of a pathname.
This file is in the public domain. */
/*
NAME
basename -- return pointer to last component of a pathname
SYNOPSIS
char *basename (const char *name)
DESCRIPTION
Given a pointer to a string containing a typical pathname
(/usr/src/cmd/ls/ls.c for example), returns a pointer to the
last component of the pathname ("ls.c" in this case).
BUGS
Presumes a UNIX or DOS/Windows style path with UNIX or DOS/Windows
style separators.
*/
#include "ansidecl.h"
#include "libiberty.h"
#include "safe-ctype.h"
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__)
#define HAVE_DOS_BASED_FILE_SYSTEM
#ifndef DIR_SEPARATOR_2
#define DIR_SEPARATOR_2 '\\'
#endif
#endif
/* Define IS_DIR_SEPARATOR. */
#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
char *
basename (name)
const char *name;
{
const char *base;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
if (ISALPHA (name[0]) && name[1] == ':')
name += 2;
#endif
for (base = name; *name; name++)
{
if (IS_DIR_SEPARATOR (*name))
{
base = name + 1;
}
}
return (char *) base;
}
|
| 02.18.2008 at 03:30AM PST, ID: 20919023 |
| 02.22.2008 at 11:22AM PST, ID: 20960468 |
| 02.22.2008 at 11:58AM PST, ID: 20960843 |