You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Solution
{
public:
void replaceSpace(char *str,int length)
{
int i, j;
int count = 0;
int len = length;
for(int i = 0; i < length; i++)
{
if(str[i] == ' ')
{
count++;
}
}
``
#include
using namespace std;
#define __tmain main
class Solution
{
public:
void replaceSpace(char *str,int length)
{
int i, j;
int count = 0;
int len = length;
for(int i = 0; i < length; i++)
{
if(str[i] == ' ')
{
count++;
}
}
};
int __tmain( )
{
char str[10 + 1] = "a b c d";
}
``
char str[10 + 1] = "a b c d";
换成:
char str[7 + 1] = "a b c d";
报错:
a%20b%20c%20d
*** stack smashing detected ***: ./004 terminated
已放弃 (核心已转储)
The text was updated successfully, but these errors were encountered: