Naiko
someone can help me with a c makefile ?
Naiko
Please, it's for a project that I have to deliver by tomorrow🙏🙏
Dav Wealth ✨
Can anyone help me with my assignment
Anonymous
Please, it's for a project that I have to deliver by tomorrow🙏🙏
You will get a response if you just ask your question without wondering if someone will help.
Anonymous
Anonymous
When I press 1 or 2 and then enter the program ends automatically
Anonymous
https://dpaste.org/dLHD same problem only onr time input enter who will play first ??? i answer this but there is one more question that computer doesn't ask the question is enterr position and symbol for yourself
Anonymous
https://dpaste.org/dLHD same problem only onr time input enter who will play first ??? i answer this but there is one more question that computer doesn't ask the question is enterr position and symbol for yourself
Check line 35 in your code. The &pa is within the string literal. It should be outside. Also there is no point in including whitespace characters like /t and /n in scanf formatting string unless you are going to enter spaces in the input upfront. Even if you did, only one of them is enough. Check line 58. You are probably using == instead of = main is supposed to return int and not void. conio.h is not a standard header. So when you include it and use it, it makes it even more difficult for people here to test your code. Use a decent compiler and pay heed to the warnings.
Anonymous
hi everyone, can anyone find me a link/reference, any source to put my hands on web development using C language only, I know it's little out of the blue, just wanna get my hands dirty for fun
Anonymous
Could you send the problem description?
Anonymous
Your time complexity is O(TN) ≈ 10^11. So got TLE. N is too large, you should improve your algorithm (e.g. O(T)).
Anonymous
Your running time as Ren suggested is 10^11. Anything above 10^9 will time out. Your logic is also wrong. You are not doing it correctly. Think about it. Given a integer k, which integer m will give the maximum value for k%m? m should be (k/2)+1.
K
Hello, How did you learn c n c++?
Anonymous
Hello, How did you learn c n c++?
From books. A good one to start with would be C++ Primer by Stanley Lippmann (5th edition)
Anonymous
if((a[0]=='x'&&a[1]=='x'&&a[2]=='x') || if(a[0]=='x'&&a[3]=='x'&&a[6]=='x') || if(a[0]=='x'&&a[1]=='x'&&a[4]=='x') ) else if((a[0]=='0'&&a[1]=='0'&&a[2]=='0') || if(a[0]=='0'&&a[3]=='0'&&a[6]=='0') || if(a[0]=='0'&&a[1]=='0'&&a[4]=='x')) error: expected expression before ' if' please help i am very very closeeee
Anonymous
How to solve an equation Formol:3n×3m input:n,m
Anonymous
example input:1 1 Out put: x. x . x. x. x
Anonymous
Thanks!! Actually I didn't tried the code given by you that's why I was cross questioning your code worked, thanks again
Anonymous
anybody needs help in c ?
Anonymous
I need help
Anonymous
Hlo
Naiko
https://pastebin.com/Gy3xxSQv
Naiko
Can anyone help me figure out what's wrong with this makefile?
Anonymous
Tic tac toe right??
Right 👍🏻
Anonymous
https://pastebin.com/Gy3xxSQv
You forgot the -c option to build the object files
Naiko
do i put it after the CFLAGS?
Anonymous
do i put it after the CFLAGS?
You can put it in CFLAGS itself seeing that you use it only to generate the object files
Naiko
"CFLAGS = -Wall -c " ?
Anonymous
And by the way $(LP) and $(PT) need to be added to the command for target abc. You dont need these libraries while compiling. You need them while linking.
Naiko
Yeah
ok I added it ... now it seems that the first file compiles without problems ... instead for compiling the second it gives me: make: *** No rule to make target 'memorizer.c', needed by 'memorizer.o'. Stop.
Anonymous
make -f Makefile.mak
Your makefile says memorizzatore.c while in your post you are referring to memorizer.c
Naiko
Anonymous
Naiko
is the same
Anonymous
is the same
What do you mean "is the same"? memorizer.c is a different filename from memorizattore.c. The make tool doesnt make a call to Google Translate to translate your file names.
Naiko
in the sense that I can translate it into my language ... obviously I don't pretend that there is an automatic translation haha
Anonymous
in the sense that I can translate it into my language ... obviously I don't pretend that there is an automatic translation haha
The compiler error you gave me says "No rule to make target 'memorizer.c'. The makefile you shared shows target memorizzatore.o depends on target memorizzatore.c and there is no memorizer.c or memorizer.o there. So the problem is with your file names. Go fix those.
Naiko
The compiler error you gave me says "No rule to make target 'memorizer.c'. The makefile you shared shows target memorizzatore.o depends on target memorizzatore.c and there is no memorizer.c or memorizer.o there. So the problem is with your file names. Go fix those.
it always tells me: gcc -lpthread esame.o memorizzatore.o /usr/bin/ld: memorizzatore.o: in function `main': /home/marco/memorizzatore.c:11: multiple definition of `main'; esame.o:/home/marco/esame.c:76: first defined here /usr/bin/ld: esame.o: in function `main': /home/marco/esame.c:111: undefined reference to `pthread_create' /usr/bin/ld: /home/marco/esame.c:122: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make: *** [Makefile.mak:9: abc] Error 1
Anonymous
And by the way $(LP) and $(PT) need to be added to the command for target abc. You dont need these libraries while compiling. You need them while linking.
And you havent read this message either. I asked you to move $(LP) and $(PT) to the linking stage. They are not used in the compiling stage. The second error that the linker shows is because of that.
Anonymous
They are actually two separate files that communicate with a pipe
Then you cant build them the way you are building them. Your makefile target is all. This tries to build memorizzatore.o and esame.o and then it tries to link them together into one executable. Since you have not mentioned this name in the linker stage, by default it will be a.out At this stage the linker figures out that there are 2 mains and complains about it. You should instead be trying to build 2 executables. And it seems like you dont know how Makefiles work in general. I would advise you to search about them and read about them before you use them.
Naiko
They are actually two separate files that communicate with a pipe
I was wrong to explain, in reality they are 2 separate files .. I just have to compile them separately
Anonymous
I was wrong to explain, in reality they are 2 separate files .. I just have to compile them separately
Read my message above and more importantly read about makefiles before attempting to use them. I cant teach you everything from scratch.
Anonymous
Hello
Anonymous
I learn C++, and who can say me nice course of C++?
Anonymous
I feel strings in c and c++ not as user friendly as in python or java! Why so?
Dumb
What do you mean?
Pavel
I feel strings in c and c++ not as user friendly as in python or java! Why so?
That's not an easy question that can be answered in one sentence. About C strings for example: https://www.quora.com/Why-do-strings-have-to-be-so-complicated-in-C About C++ std::string, it's not as user friendly as string types in languages that was created after C++, but can you give some examples what exactly you feel not friendly in C++ strings?
Anonymous
That's not an easy question that can be answered in one sentence. About C strings for example: https://www.quora.com/Why-do-strings-have-to-be-so-complicated-in-C About C++ std::string, it's not as user friendly as string types in languages that was created after C++, but can you give some examples what exactly you feel not friendly in C++ strings?
I mean using pointers and pointers to pointers, array of pointers, always having logic construct of strings in mind while initilising charecter arrays, input and output stream all these make usage of strings complicated! Actually i being frm mechanical background learnt python first and then now i am learning C, C++! I think its reverse engineering kinda and i feel C, c++ strings not as natural as in python and java
@𝑺𝒐𝒃𝒌𝒂
Hi! Apart from shift operators used in IO, are bitwise operators (very) useful? I was reading about it and it seems bewildering for me.
Anonymous
Hi! Apart from shift operators used in IO, are bitwise operators (very) useful? I was reading about it and it seems bewildering for me.
"|" is useful in cpp20 range library. https://en.cppreference.com/w/cpp/ranges In addition, you can overload the operator if you like. It can sometimes cause confusion.
Harsh
Hello
@𝑺𝒐𝒃𝒌𝒂
"|" is useful in cpp20 range library. https://en.cppreference.com/w/cpp/ranges In addition, you can overload the operator if you like. It can sometimes cause confusion.
I found the topic in a book that use C++11. I read the content of your link but still confused because I'm not familiar with C++20. Thanks anyway
Anonymous
why does upper_bound work with unsorted arrays as well?
Ravi
why does upper_bound work with unsorted arrays as well?
it depends on the element you apply on. It does not always work well
Anonymous
why does upper_bound work with unsorted arrays as well?
upper_bound doesnt require a completely sorted array. It will work on a partitioned array as long as the element that you are searching for say v, partitions the array into two parts...those that are less than or equal to v (assuming you are using the default < operator) and those that are greater than v. A sorted array satisfies this criteria
Naiko
Read my message above and more importantly read about makefiles before attempting to use them. I cant teach you everything from scratch.
ok I reviewed the makefiles and fixed mine but it still doesn't work ... it tells me "make: Nothing to be done for 'all'." ....https://pastebin.com/idLpy8Yp
Naiko
I did it but it doesn't change anything
Anonymous
Show me your makefile again