Anonymous
Who can solve a C programming quiz ?
Sachin
I
📌
Hi guys
How get addition of two numbers in two different classes ?
Thank you
Anshul
Anonymous
in BS, after every iteration, the size is divided by 2, so if the size is n, it gets repeatedly divided by 2
after like n1 number of division, the length becomes 1
thus length becomes (n/2)*n1 which equals to 1
put log on both side
and you get the value of n1
thus O(logn)
Sachin
Sachin
Anonymous
Any admin online please?
olli
Anonymous
This is an urgent task that needs to be done today, there is a problem that keeps crashing our project and we need to point that out, we catch some logs by debugging it but it is not clear to us. We are looking forward to someone who can fix this.
The project is using C++ and also we need someone who has experience with WinSock.
This will be a paid task, if someone is interested give me a dm. Thank you
Anonymous
#meta
That's why I am asking if there is any admin available to ask permission if I can post this or not.
Shahar
Question regarding CLion usage.
I have a project (C++) directory on my Linux machine.
I want to open this project directory in CLion such that it automatically creates a suitable CMakeList for it.
Does someone know to how to do that?
klimi
klimi
cmakelist is just a description of you project
Shahar
there is no such thing
So in case I have a project directory which contains headers and sources, also including other directories of header and sources, there is no a fast way to load it into a CMake?
klimi
i think the fastest
klimi
is to create new project so you get basic cmake
klimi
and then you add them to the description
Shahar
klimi
well ya?
klimi
or i think that cmake has globbing... if you want to use that
Shahar
well ya?
and if i have also directories? i have to include them like directory/file1 directory/file2 directory/file3 etc.?
klimi
klimi
https://stackoverflow.com/questions/2110795/how-to-use-all-c-files-in-a-directory-with-the-cmake-build-system
klimi
klimi
so you can use that
klimi
cmake_minimum_required(VERSION 3.0)
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.c")
add_executable(main ${SOURCES})
Anshul
Anyone here have done pair programming? I want to know how does that help?
And is anyone interested!
meis
Sandro
https://github.com/Sandroid75/Phonebook
J.K. – Tessier-Ashpool Customer Support
How can I know where is my argv[1] placed on the stack in NASM? (I'm using IDA, which I'm liking it better than Ghidra for debugging and I'm learning to read NASM)
olli
J.K. – Tessier-Ashpool Customer Support
J.K. – Tessier-Ashpool Customer Support
olli
ELF64, AMD64, C, Linux
Of course! BRB
Assuming SystemV ABI [https://uclibc.org/docs/psABI-x86_64.pdf, page 21]
Register | Usage
---------+---------------------------
rsi | used to pass 2nd argument
| to functions
J.K. – Tessier-Ashpool Customer Support
Bingo. Just that I don't know what ABI means
J.K. – Tessier-Ashpool Customer Support
J.K. – Tessier-Ashpool Customer Support
https://codeshare.io/2EKn70
All my code. No headaches for anyone. I don't know how to pick this up. When I get to loc_5617B7F771EE at line 00005617B7F771FE, I don't know where does my input (aaaa) came from.
J.K. – Tessier-Ashpool Customer Support
Again, this is another CTF challenge which was assigned to me, but I don't know how to handle them. I've never seen ASM in my entire life and today I learnt the basics for reading it. But anyway I can't figure out where did my parameter come from. 🤷🏻♂
Anonymous
hello can anyone help me? why my program is not working
Anonymous
void updateRecords(FILE *ptr){
struct customer upDate={0,"","",0};
rewind(ptr);
fread(&upDate,sizeof(struct customer),1,ptr);
while(!feof(ptr)){
if(upDate.deposit>=300){
upDate.deposit=upDate.deposit+50;
fseek(ptr,(upDate.account-1)*sizeof(struct customer),SEEK_SET);
fwrite(&upDate,sizeof(struct customer),1,ptr);
}
fseek(ptr,(upDate.account-1)*sizeof(struct customer),SEEK_SET);
fread(&upDate,sizeof(struct customer),1,ptr);
}
printf(" Records updated.\n"); fclose(ptr);
}
Terrence
Terrence
void updateRecords(FILE *ptr){
struct customer upDate={0,"","",0};
rewind(ptr);
fread(&upDate,sizeof(struct customer),1,ptr);
while(!feof(ptr)){
if(upDate.deposit>=300){
upDate.deposit=upDate.deposit+50;
fseek(ptr,(upDate.account-1)*sizeof(struct customer),SEEK_SET);
fwrite(&upDate,sizeof(struct customer),1,ptr);
}
fseek(ptr,(upDate.account-1)*sizeof(struct customer),SEEK_SET);
fread(&upDate,sizeof(struct customer),1,ptr);
}
printf(" Records updated.\n"); fclose(ptr);
}
The if and while loop seem to be incomplete and unclear
Sachin
.
Hello, an apology can you help me in why I get an error in this code?
.
#include <stdio.h>
int main ( )
{
int n , matriz [ 1000 ] , c , d , t , bandera = 0 ;
printf ( "Ingrese el número de elementos \ n " ) ;
scanf ( "% d" , & n ) ;
printf ( "Ingrese% d enteros \ n " , n ) ;
for ( c = 0 ; c < n ; c ++ )
scanf ( "% d" , & array [ c ] ) ;
for ( c = 1 ; c <= n - 1 ; c ++ ) {
t = matriz [ c ] ;
for ( d = c - 1 ; d > = 0 ; d - ) {
if ( matriz [ d ] > t ) {
matriz [ d + 1 ] = matriz [ d ] ;
bandera = 1 ;
}
romper ;
}
if ( bandera )
matriz [ d + 1] = t ;
}
printf ( "Lista ordenada en orden ascendente: \ n " ) ;
for( c = 0 ; c <= n - 1 ; c ++ ) {
printf ( "% d \ n " , matriz [ c ] ) ;
}
return 0 ;
}
.
In the Scanf ("% d", & array [c]);
Anonymous
Ģhòšţ
I've read the rules and I agree with them
Anonymous
Can someone explain me this function?
void print(node *temp, string word)
{
if (temp->h.empty())
{
cout << word << endl;
return;
}
if (temp->isterminal)
{
cout << word << endl;
}
node *t;
string w;
for (auto it = temp->h.begin(); it != temp->h.end(); it++)
{
t = temp->h[it->first];
w = word + it->first;
print(t, w);
}
return;
}
Anonymous
Talula
Sid Sun
https://twitter.com/katherinecodes/status/1400820538780446732?s=09
abdullah reveha
hello guys. how can i compare struct and string? I used strcmp function but it didn't work.
佳辉
#include <stdio.h>
int main()
{
float a,b,res;
char choice;
do
{
printf("1.Addition\n");
printf("2.Subtraction\n");
printf("3.Multiplication\n");
printf("4.Division\n");
printf("5.Exit\n\n");
printf("Enter Your Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a+b;
printf("Result:%d",res);
break;
case 2 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a-b;
printf("Result:%d",res);
break;
case 3 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a*b;
printf("Result:%d",res);
break;
case 4 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a/b;
printf("Result:%d",res);
break;
case 5 :
return 0;
break;
default :
printf("Wrong Choice..!!");
break;
}
printf("\n------------------------------------\n");
}
while(choice<=5);
}
佳辉
can someone hep me this?i cant get the result,i dont know where is my error
Anonymous
check fromat operators
Anonymous
#include <stdio.h>
int main()
{
float a,b,res;
char choice;
do
{
printf("1.Addition\n");
printf("2.Subtraction\n");
printf("3.Multiplication\n");
printf("4.Division\n");
printf("5.Exit\n\n");
printf("Enter Your Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a+b;
printf("Result:%d",res);
break;
case 2 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a-b;
printf("Result:%d",res);
break;
case 3 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a*b;
printf("Result:%d",res);
break;
case 4 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a/b;
printf("Result:%d",res);
break;
case 5 :
return 0;
break;
default :
printf("Wrong Choice..!!");
break;
}
printf("\n------------------------------------\n");
}
while(choice<=5);
}
#include <stdio.h>
int main()
{
int a,b,res;
char choice;
do
{
printf("1.Addition\n");
printf("2.Subtraction\n");
printf("3.Multiplication\n");
printf("4.Division\n");
printf("5.Exit\n\n");
printf("Enter Your Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a+b;
printf("Result:%d",res);
break;
case 2 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a-b;
printf("Result:%d",res);
break;
case 3 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a*b;
printf("Result:%d",res);
break;
case 4 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a/b;
printf("Result:%d",res);
break;
case 5 :
return 0;
break;
default :
printf("Wrong Choice..!!");
break;
}
printf("\n------------------------------------\n");
}
while(choice<=5);
}
Anonymous
#include <stdio.h>
int main()
{
float a,b,res;
char choice;
do
{
printf("1.Addition\n");
printf("2.Subtraction\n");
printf("3.Multiplication\n");
printf("4.Division\n");
printf("5.Exit\n\n");
printf("Enter Your Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a+b;
printf("Result:%d",res);
break;
case 2 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a-b;
printf("Result:%d",res);
break;
case 3 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a*b;
printf("Result:%d",res);
break;
case 4 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a/b;
printf("Result:%d",res);
break;
case 5 :
return 0;
break;
default :
printf("Wrong Choice..!!");
break;
}
printf("\n------------------------------------\n");
}
while(choice<=5);
}
at starting you declared a,b,res as float type later in code u used int type (%d) format operator instead of float (%f) thats the reason : ) have a great day
佳辉
佳辉
Anonymous
GHAMDAN_NSHWAN
Hii
GHAMDAN_NSHWAN
Send me
Example of class was c++
Anonymous
佳辉
#include <stdio.h>
int main()
{
int a,b,res;
char choice;
do
{
printf("1.Addition\n");
printf("2.Subtraction\n");
printf("3.Multiplication\n");
printf("4.Division\n");
printf("5.Exit\n\n");
printf("Enter Your Choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a+b;
printf("Result:%d",res);
break;
case 2 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a-b;
printf("Result:%d",res);
break;
case 3 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a*b;
printf("Result:%d",res);
break;
case 4 :
printf("Enter first number : ");
scanf("%d",&a);
printf("Enter second number : ");
scanf("%d",&b);
res=a/b;
printf("Result:%d",res);
break;
case 5 :
return 0;
break;
default :
printf("Wrong Choice..!!");
break;
}
printf("\n------------------------------------\n");
}
while(choice<=5);
}
What if i want to add a function inside this code?
GHAMDAN_NSHWAN
Anonymous
GHAMDAN_NSHWAN
Anonymous
Anonymous
javatpoint
tutorials point
Anonymous
these are some websites
Anonymous
where u can find examples for each topic
佳辉
Okok
GHAMDAN_NSHWAN