Results 1 to 25 of 26
Thread: C
Hybrid View
-
25th December 2007 17:23 #1Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
C
.
: " . 3 . , , . ( strcat(to,from) ). :"Noviyat niz e: %S", . . : "Izberete edno ot pokazanite po-gore iregheniya (cifra ot 1 do 3):", . switch ( strcat(to,from)) i se izdava syob]enie:" Finalniyat niz moje da vi haresa: \n%s". . () .
: char *Sg[] = {"vseki_","den_","se_","chudya_","i_","" se_","maya_"};.
: "gde shte mu izleze kraya." , "dali tryabva da si traya." , " i za programata nehaya.".
: strcat(to.from) - "to" , ; "from" , ."
-
25th December 2007 17:43 #2
strcat char* . strcat("hello ", "world") "hellow world".
? .
-
25th December 2007 18:06 #3Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
,
strcat() - . .
- :
1. Sg
2. ,
2.1. 3-
2.2. 1 3, 2.1.
2.3. ,
2.4. , , '' , ( 3)
2.5. 2.1.
3. !
, . , , .
@moridinbg -
, , (- ).
-
25th December 2007 18:34 #4
moridinbg e , "Hello world".
strcat , , .. : ="Kondio qde " b="spanak", strcat(a,b) b, , , "Kondio qde spanak", strcat "" &a.
, ...Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
25th December 2007 18:48 #5Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
-
25th December 2007 19:14 #6
-
25th December 2007 20:01 #7Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
-
25th December 2007 20:57 #8Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
while (1)
{
// --
// -------
if (----1--3)
continue;
// ---------
if (--)
break;
}
printf() puts()
getch() gets()
atoi()
-
25th December 2007 23:09 #9
, . strcat e
tmp1 "Hello world". 12 . 20 .Code:char tmp1[20] = "Hello "; char tmp2[] = "World"; strcat(str1, str2);
-
26th December 2007 14:39 #10Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
, - C/C++.
. - , - . -
char result[12]; // 12
char *tmp1 = "Hello ";
char *tmp2 = "world";
strcpy(result, tmp1); //
strcat(result, tmp2); // , result "Hello world"
-
26th December 2007 17:05 #11
-
27th December 2007 12:43 #12, ! , "Hello" "world" , .! 'Access violation' exception.Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19
-
2nd January 2008 18:52 #13Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
Code:#include<stdio.h> #include(conio.h> #include<string.h> void main { intN; char *Sg[] = {"Vseki_","den_","se_","chudya_","i_","se_","maya_"}; strcat
http://www.cplusplus.com/reference/c...ng/strcat.html
strcat ,
.
" strcat(to,from)" to i from
-
2nd January 2008 19:21 #14
, @lz1nia. char temp[1000]. strcpy(temp, "") . strcat(temp, <>) <>, Sg[1] ( , , .. "den_"), , "alabala". , .
, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
2nd January 2008 19:55 #15Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
-
2nd January 2008 23:49 #16, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
13th January 2008 13:47 #17Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
. , ?Code:#include<stdio.h> //#include(conio.h> //#include<string.h> int main() { char *Sg[] = {"Vseki_","den_","se_","chudya_","i_","se_","maya_"}; for(int i=0; i<7; i++) { printf(Sg[i]); } return 0; }
-
13th January 2008 14:13 #18
? Dev-CPP, :
1) system("pause"); return 0;
2) ., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
13th January 2008 15:40 #19Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
Borland C version 3.1
-
13th January 2008 16:49 #20
-
13th January 2008 17:08 #21Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
8 :Code:#include<stdio.h> #include<iostream.h> #include<conio.h> int main() { char *Sg[] = {"vseki_","den_","se_","chudya_","i_","se_","maya_"}; for (int i = 1; i < 7; i++) { strcat(Sg[0],Sg[i]); } printf("Noviyat niz e: %S"); printf(Sg[0]); char *Sg2[] = {"gde shte mu izleze kraya.","dali tryabva da si traya."," i za programata nehaya."}; for (int j = 0; j < 3; j++) { printf(Sg2[j]); printf("\n"); } printf("Izberete edno ot pokazanite po-gore iregheniya (cifra ot 1 do 3):"); int n; scanf("%d", &n); switch (n) { case n = 1 : {printf(Sg[0]);printf(Sg2[n]);} case n = 2 : {printf(Sg[0]);printf(Sg2[n]);} case n = 3 : {printf(Sg[0]);printf(Sg2[n]);} default : printf("Ibrali ste newalidno ireghenie"); } return 0; }
1. function 'strcat should have a prototype
2. case n = 1 : {printf(Sg[0]);printf(Sg2[n]);} constant expression required
3. case 3 - duplicate case
4. case 3 -case outside ot switch
5. return 0; - declaration terminated incorectly
-
13th January 2008 17:15 #22
1. #include <string.h>
2. :
case break;, .Code:switch (n) { case 1: ... case 2: ... default: ... }
3. 4. 5. 2.Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
13th January 2008 20:00 #23Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
, .
?
Code:#include<stdio.h> #include<iostream.h> #include<conio.h> #include<string.h> int main() { char *Sg[] = {"vseki_","den_","se_","chudya_","i_","se_","maya_"}; for (int i = 1; i < 7; i++) { strcat(Sg[0],Sg[i]); } printf("Noviyat niz e: %S"); printf(Sg[0]); char *Sg2[] = {"gde shte mu izleze kraya.","dali tryabva da si traya."," i za programata nehaya."}; for (int j = 0; j < 3; j++) { printf(Sg2[j]); printf("\n"); } printf("Izberete edno ot pokazanite po-gore iregheniya (cifra ot 1 do 3):"); int n; scanf("%d", &n); switch (n) { case 1 : {printf(Sg[0]);printf(Sg2[n]);} break; case 2 : {printf(Sg[0]);printf(Sg2[n]);} break; case 3 : {printf(Sg[0]);printf(Sg2[n]);} default : printf("Ibrali ste newalidno ireghenie"); } return 0; }
-
14th January 2008 18:49 #24
1) printf() :
.. printf(), "%s" .Code:char *s[] = {"hi", "bye"}; printf("Blablabla, I wanted to say %s", s[0]);
2) strcat()- , char temp[1000] = ""; strcat(temp, Sg[i]);
., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
16th January 2008 19:28 #25Banned
Join Date: Jun:2006
Location: sofia
Posts: 68
:
, conio.h ????Code:#include <conio.h> #include <stdio.h> #include <string.h> int main( ) { int i, j, n; char StrResult[200] = ""; char *Sg[] = {"vseki_", "den_", "se_", "chudya_", "i_", "se_", "maya_"}; char *Sg2[] = {"gde shte mu izleze kraya.", "dali tryabva da si traya.", " i za programata nehaya."}; for ( i = 0; i < 7; i++ ) strcat( StrResult, Sg[i] ); printf("Noviyat niz e: %s\n\n", StrResult ); for ( j = 0; j < 3; j++ ) printf( "%d) %s\n", j + 1, Sg2[j] ); printf( "Izberete edno ot pokazanite po-gore iregheniya (cifra ot 1 do 3):"); scanf( "%d", &n ); if ( n < 1 || n > 3 ) printf( "Izbrali ste newalidno izrechenie!\n" ); else { strcat( StrResult, Sg2[n-1] ); printf( "Finalniyat niz moje da vi haresa:\n%s\n", StrResult ); } getch(); return 0; }




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in