Nameful
yes, why?
Ahadu
Do you create any app
I mean any app can create you
Anunay
I mean any app can create you
What kind of AI is creating humans?
Anunay
😆
Ahadu
I am begginer for C++.i am not idea how can write a program any one help me?
J
Anyways let’s stop the negativity here, congrats on being a self taught programmer Udoh
You need not congratulate me. You need congratulate all of us. We are all self taught programmers and that is what you need to do too
Amu
You need not congratulate me. You need congratulate all of us. We are all self taught programmers and that is what you need to do too
no hard feelings udoh lets just stop this ok? i admit i’m not a self taught programmer, i’m just a computer science student who was stuck on a homework and wanted support here. And yes its great that everyone is working towards being a proficient programmer.
Bumpy
Hello eve, I have two files (hpp,cpp) In the hpp files I declared a overloading function and I want to implement them on the cpp file.
Bumpy
When I’m compile I get an error of all my functions : “must be a unary/binary operator”
Bumpy
Anyone know why?
hiddenpiggy
show me your code
Distac_221
#include <stdio.h> #include <sys/socket.h> #include <errno.h> #include <netdb.h> #include <string.h> #include <stdlib.h> int main(int argc, char **argv){ struct hostent *host; int err, i, sock, start, end; char hostname[100]; struct sockaddr_in sa; printf("Enter hostname or IP:"); gets(hostname); printf("\n"); printf("Enter start port number: "); scanf("%d", &start); printf("\n"); printf("Enter end port number: "); scanf("%d", &end); memcpy((char*)&sa, "", sizeof sa); sa.sin_family = AF_INET; if(isdigit(hostname[0])){ sa.sin_addr.s_addr = inet_addr(hostname); } else if ( (host = gethostbyname(hostname)) != 0){ memcpy((char*)&sa.sin_addr, (char*) host->h_addr, sizeof sa.sin_addr); } else { herror(hostname); exit(2); } for(i = start; i <= end; i++){ printf("Scanning port %i\n",i); sa.sin_port = htons(i); sock = socket(AF_INET, SOCK_STREAM, 0); if(socket < 0){ exit(1); } err = connect(sock, (struct sockaddr*)&sa, sizeof sa); if (err < 0){ fflush(stdout); } else { printf("Port %i is open\n", i); } close(sock); } fflush(stdout); return 0; }
Distac_221
how can i make this to work on atmega32
Distac_221
i want to do some tcp/udp port scanning
A
hi
Anonymous
Hello everyone
Anonymous
I am fresher to c++
Anonymous
Which book is best for c ++
Anonymous
Please suggest
Gabriel
Anonymous
Which book is best for c ++
read rule 5 in pinned message.
Nameful
I'm very curious why anyone would prefer autotools
Nameful
I don't have any vendetta against GNU, but I never found autotools to be very pleasant to work with
Gabriel
I think that Autotools is very hard to understand!
Lion
You can't go back and blame the old days
Nameful
/get cppbookguide
Why is this in reply to me
Anonymous
sorry, wrong replying[
Anonymous
klimi
i think you messed your things here, they are different things
[Gaal wase bilaa cashuur ]?_ 2 grals
Yes
klimi
cmake is something else than make for example
klimi
and cmake cannot compile by itself like make does
Nameful
cmake is something else than make for example
Yeah, sure, but CMake and Meson are very comparable
Nameful
And I think Autotools is comparable to them as well
klimi
why is make there then
Nameful
Idk
Dima
wow such c++ related
Dima
but it’s QT anyways
klimi
wow such c++ related
that happens to you when you do C for way too long
Mark
Pls can someone help with this: What is the largest numeric value that could be represented with three bytes if each digit were encoded using one ASCII pattern per byte? What if binary notation were used?
Hariyana Grande
#include <stdio.h> const int MAX = 3; int main () { int var[] = {10, 100, 200}; int i, *ptr; /* let us have array address in pointer */ ptr = var; //MY QUESTION IS ABOUT THIS PART, WHY NOT ptr = &var; for ( i = 0; i < MAX; i++) { printf("Address of var[%d] = %x\n", i, ptr ); printf("Value of var[%d] = %d\n", i, *ptr ); /* move to the next location */ ptr++; } return 0; }
Hariyana Grande
why did they skip "&" in ptr=var; ?
oogeek
var actually points to the first element of that array
Hariyana Grande
this var is array in this programm which of int type right
Hariyana Grande
yes that i know
Hariyana Grande
but still as pointer stores the address of var
Hariyana Grande
so we need & to store the address right?
Hariyana Grande
wait
Hariyana Grande
No, reread the printf part
im dumb still didnt get it please tell me
Hariyana Grande
instead of %u they used %x i guess
Hariyana Grande
in first printf
oogeek
ptr has type int * var also have type int * var[1] is actually *(var+1) So assign var to ptr is OK. Then by ptr++ and *ptr, the number stored at each place will be passed to printf
mayway
Anyone one have any idea where i can learn c++ for free
Hariyana Grande
ptr has type int * var also have type int * var[1] is actually *(var+1) So assign var to ptr is OK. Then by ptr++ and *ptr, the number stored at each place will be passed to printf
ptr has type int* ✅ var also have type int* ✅, var[1] is pointer to the first element ,✅, so assign var to ptr is basically like assinging pointer to poiner right?
Anonymous
Hey could anyone help on how to encrypt file. Just a simple method not that hard
Hariyana Grande
var[1] is the actually value of the second element, the first one being var[0],the other are correct
sure but is it my statement right that assinging var to ptr is like assigning point (ptr in thsi case) to pointer( var[1]) right?
Hariyana Grande
var[1] is int, var is pointer, assign is ok
ok got it thank you so much i appreciate you time
oogeek
Hariyana Grande
😁
Anonymous
....
Are you banned in Google or what?
Anonymous
Are you banned in Google or what?
This is not how you respond
Anonymous
I already searched
Anonymous
I thought you guys could guide me.
Anonymous
I already searched
https://stackoverflow.com/questions/16219239/simple-encryption-algorithm ....
Anonymous
Ok thanks
Talula
Hey could anyone help on how to encrypt file. Just a simple method not that hard
https://stackoverflow.com/questions/180870/what-is-the-best-encryption-library-in-c-c
Hariyana Grande
ptr has type int * var also have type int * var[1] is actually *(var+1) So assign var to ptr is OK. Then by ptr++ and *ptr, the number stored at each place will be passed to printf
this is last question- in this expression " *(var+1) " is var a offset? i just came across this term recently and after seeing this expression cant stop thinking about it.
oogeek
But var is actually virtual address, the compiler will take care of that.
Hariyana Grande
thank you for clearing that too
Anonymous
Hello