strcpy

    0

    1답변

    void main() { char str1[10], str2[10] = "haha"; strcpy(str1, str2); puts(str1); strcpy(str1, "tictoc"); puts(str1) ; } 위의 코드 에서처럼 C 언어로 미리 정의 된 strcpy 함수를 통해 포인터 변수에 전달되는

    0

    2답변

    문제가 있습니다. 내가 다음 단계 proceede하려고 : char * str; char * s="Hello"; int len = std::strlen(s); str=new char[len +10]; strcpy_s(str,sizeof(str) ,s); 을하지만 programm에 내가 제목에 쓰기 오류를 표시합니다.

    -1

    1답변

    구조체의 멤버 인 char 배열에 대해 값을 설정하기 위해 strcpy를 사용하려고합니다. 가능한 경우 포인터 연산자를 사용하여이 작업을 수행하려고합니다. struct my_struct{ char foo[15]; } *a_struct_Ptr; int main(){ strcpy(a_struct_Ptr -> foo, "test"); r

    -1

    2답변

    최근에 객체를 삭제하고 예외가 발생하고 strcpy()를 사용하도록 범위를 좁혔습니다. 이를 테스트하기 위해 strcpy()와 voila (예외적)만을 (기본적으로) 사용하는 간단한 테스트 클래스를 만들었습니다. #pragma once class TestClass { public: TestClass(char []); ~TestClas

    1

    1답변

    내 프로그램을 디버깅하는 중 마지막 행이 발생했습니다. 어떻게 해결할 수 있습니까? -fno-builtin을 사용하여 strcpy()을 살펴 보았지만 __strcpy_sse2_unaligned이 호출 중임을 보여줍니다. [email protected]:~/booksrc# gcc -fno-builtin -g char_array2.c [email protec

    0

    2답변

    #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <string.h> #include <strings.h> #include <stdlib.h> #include <unistd.h> #

    -1

    1답변

    다음 코드는 향후 game.answer의 내용을 삭제하므로 그 이유를 알 수 없습니다. 이 구조입니다 : typedef struct { int guesses, guessesAllowed; char* answer; char max; } GameState; 그리고 이것은 내 함수는 새로운 구조를 구축하는 것입니다 : 나는 그것

    -1

    2답변

    논리적으로이 작업을 수행 할 생각이 없습니다. 정렬에 대한 모든 가능성을 배웠고 그것에 대한 알고리즘을 기반으로했습니다. ABC ACB BAC BCA CAB CBA 그래서 3 문자열 및에서만 여섯 가능한 조합이 생각 그것은 매우 co와 함께 이것을 하드 코딩하는 빠르고 쉬운 솔루션 nditionals. 코드를 참조하십시오. char str1[x]; // w

    0

    1답변

    strncpy을 사용한 다음 strcpy을 사용하려고 시도했지만 그 반대로 실행 중에 세그먼트 오류가 계속 발생했습니다. 나는 이것이 기능의 논리적 인 오류 때문이라고 생각했지만, 나는 그들의 장소를 바꾸었고 오직 첫번째 것이 실행되었다. #include <stdio.h> #include <string.h> int main(void) { c

    1

    1답변

    세 나라의 첫 글자의 작은 문자 strcpy_s,이 코드입니다 : #include<iostream> #include<string> using namespace std; int main() { void smallest_string(char str[][30], int); int i; char country_name[3][30]