✨Justina
for (int i=0; i<size; i++)
{
cout<<"Enter your Number "<<i+1<<":";
cin>>Value;
hebat.push_back(value);
}
Largest = findLargest(hebat);
cout<<"The Largest Value is :"<<Largest;
return 0;
}
int findLargest(vector<int>&temp)
{
int max=temp[0];
for(int j=i; j<temp.Size();j++)
{
if(temp[j]>max)
max=temp[j];
}
return max;
}
✨Justina
Compiler tll this part wrong
✨Justina
What I need to change now?
artemetra 🇺🇦
artemetra 🇺🇦
correct me if i'm wrong
Anonymous
Hello
Anonymous
YouTube tutorials for c++ ?
✨Justina
klimi
YouTube tutorials for c++ ?
This is telegram group, if you wants youtube tutorials you should go to youtube.com and write "c++ tutorial"
Anonymous
Kaashᅠ
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
Hi
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
Write a program that receives a real number x and an integer n from the user. Use loop to calculate x. The program for 0 <n must also work correctly.
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
Do you know it?
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
klimi
i mean.... what does it mean "calculate x" what is x anyway?
klimi
it's an input from a user... how are we supposed to calculate it if it is an input
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
Write a function such that the hundredth array A (of type double) takes a number v (of type double) and an array of hundredth B (again of type double) and performs the multiplication operation on the number v × A = B. Show how in main you can use this function to multiply the vector X by 5 and put it in the vector Y. The program must include a complete definition of the function,
Define the variables X, Y and use the function by main
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
klimi
What about it?
about this? this sounds like some assigment from some school
𝕄𝕠𝕙𝕒𝕞𝕞𝕒𝕕
Bojan_Krdemn
Hi! Anybody want to give a hint how to calculate the height of a binary tree?
Backtracking comes to mind, biut not sure though.
Simon
Ok
Medi
int abrirFicheros(FILE** fichero, FILE** salida)
{
char nombre[100];
int est = 0;
char sal[100];
strcpy(nombre, "");
// ---------------PEDIMOS FICHERO LECTURA-------------------------------------------------------------
printf("FICHERO: ");
scanf("%s", nombre);
char strDef[100], dot = '.';
strcpy(strDef, "");
int i = 0, j = 0, foundChar = 0, length = strlen(nombre);
while(i < length)
{
if (nombre[i] != dot && foundChar == 0)
{
j = j +1;
}
else
{
foundChar = 1;
}
i = i + 1;
}
strncpy(strDef, nombre, j);
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(strDef, "b_Sa.txt"/*strcat(strDef, "_salida.txt")*/);
strcat(strDef, "_salida.txt");
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(sal, strDef);```Someone knows how to correctly create the string ```strDef The idea is to have the same string 'nombre' but only the left until the dot is found and the concatenate '_salida.txt'
Medi
The first time i run the program is right but if in the same program i call that function the strDef value is ab�_salida.txt why is � in there?
\Device\NUL
Medi
UB?
\Device\NUL
Medi
but code seems right?
Pavel
\Device\NUL
Undefined
Ah thanks for correcting
Medi
note: expected ‘char * restrict’ but argument is of type ‘char **’
122 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
Medi
maybe is this?
Medi
the weird thing is that the first time i call it do it right, but not the second
\Device\NUL
int abrirFicheros(FILE** fichero, FILE** salida)
{
char nombre[100];
int est = 0;
char sal[100];
strcpy(nombre, "");
// ---------------PEDIMOS FICHERO LECTURA-------------------------------------------------------------
printf("FICHERO: ");
scanf("%s", nombre);
char strDef[100], dot = '.';
strcpy(strDef, "");
int i = 0, j = 0, foundChar = 0, length = strlen(nombre);
while(i < length)
{
if (nombre[i] != dot && foundChar == 0)
{
j = j +1;
}
else
{
foundChar = 1;
}
i = i + 1;
}
strncpy(strDef, nombre, j);
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(strDef, "b_Sa.txt"/*strcat(strDef, "_salida.txt")*/);
strcat(strDef, "_salida.txt");
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(sal, strDef);```Someone knows how to correctly create the string ```strDef The idea is to have the same string 'nombre' but only the left until the dot is found and the concatenate '_salida.txt'
You don't even need strcpy(nombre, "");
just char nombre[100] = "";
\Device\NUL
please use maximum field with in scanf so buffer overflow wont happen
Medi
How can i do that?
\Device\NUL
How can i do that?
scanf("%lengthformatspecifier");
Example
scanf("%100[^\n]", str);
\Device\NUL
int abrirFicheros(FILE** fichero, FILE** salida)
{
char nombre[100];
int est = 0;
char sal[100];
strcpy(nombre, "");
// ---------------PEDIMOS FICHERO LECTURA-------------------------------------------------------------
printf("FICHERO: ");
scanf("%s", nombre);
char strDef[100], dot = '.';
strcpy(strDef, "");
int i = 0, j = 0, foundChar = 0, length = strlen(nombre);
while(i < length)
{
if (nombre[i] != dot && foundChar == 0)
{
j = j +1;
}
else
{
foundChar = 1;
}
i = i + 1;
}
strncpy(strDef, nombre, j);
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(strDef, "b_Sa.txt"/*strcat(strDef, "_salida.txt")*/);
strcat(strDef, "_salida.txt");
printf("\nNOMBRE FICHERO SALIDA: %s\n", strDef);
//strcpy(sal, strDef);```Someone knows how to correctly create the string ```strDef The idea is to have the same string 'nombre' but only the left until the dot is found and the concatenate '_salida.txt'
You can also include in the if statemnt to find NULL character rather using strlen
Denis
HELP The text is given. Write a program that cyclically shifts all lines of input text to the right by eight positions.
D
Is there anyone who had done railway reservation system case study in c++
morningstar
Hello guys, I only understand this source code superficially:
bool digit_seen[10] = {false}
int
long n;
printf("Enter a number: ");
scanf("%ld", &n);
while (n > 0) {
digit = n % 10;
if (digit_seen[digit])
break;
digit_seen[digit] = true;
n /= 10;
}
if (n > 0)
printf("Repeated digit! \n");
else
printf("No repeated digit\n");
I understand most of them; however, I couldn't comprehend the "if (digit_seen[digit])" properly and was only able to get the gist of it.
Could anyone explain it to me? Thanks a lot!
Anonymous
morningstar
Max
Who knows how to read data from the svc file which are separated by commas and in quotes
For example
"375291", "California Valley", "Jorhs Washington 37, 159"
And write data through a structure like
int number [10],
string place [50],
char adress [50]?
itsmanjeet
Hey everyone,
Anybody who speak the language of regex 😅
I need help
Need to make a regex pattern to replace the value after =
Example
Variable=/path/to/value args
^Variable=(.*?)
😅 The max that i can understand
Basically i need to replace the "/path/to/value" only
"Variable" is constant
"args" need to be as it is
coal
coal
assuming there's always a space after the segment following =
coal
+? means "match non-greedy"
coal
meaning it will end the capture when the next character is found
Talula
Yeah... why?
Talula
Yeah but I have never used Database with C/C++
Talula
Sure
PREM SAGAR
Tell me any projects of website related
Prince Fine
👀 if you guys want I can share you a PowerPoint files that we use to learn at HiLCoE
Samir
Hi guys
Samir
I have just started learning c++
What do you think should I start lea ing c++ or another langauge
coal
like, if you're an absolute beginner you'll feel motivated when you progress
coal
if you dont understand C++ you'll feel stressed if you dont manage to make your code work because of obscure low level errors you might not understand
coal
that's why it's easier to learn C++ when you have a lot of background in programming, or when someone is teaching you.
coal
if you want to go for the challenge, go for C++ if you wish, it's a beautiful language with lots of features and you'll feel comfortable with the time
Mohammad Reza
Ludovic 'Archivist'
I think that the main issue is that to learn C++, you should learn other less paradigm packed languages: somethings like {erlang, elixir, scheme, closure} {js, Lua, julia} {java, c#} {haskell, coq, apl} to familiarize with respectively functional constructs, dynamic/type erased constructs, object based constructs and algebraic constructs
Stefano
Guys can I read from three different pipes sequentially?
read(pipein,&dato_letto_a,sizeof(dato_letto_a));
read(pipein1,&dato_letto_p,sizeof(dato_letto_p));
read(pipein2,&dato_letto_n,sizeof(dato_letto_n));
Samir
Mohammad Reza
Muyi
Tha ks
P
I want to learn C++ 11 and above versions
P
Can anyone guide
Pradevel (Pratyush)
Lol
coal
I want to learn C++ 11 and above version