Edurolp
also a function to show usage
Edurolp
and a function to parse the arguments
Anonymous
the hardest part will be making sure my input is formatted how i want etc
Edurolp
wait, ill find easier code for that
Anonymous
//Demonstration of variables #include <iostream> #include <string> using namespace std; static void showUsage(char** argv) { cerr << "GNU area version 0.01-beta\n" << "Usage: area <width> <height>\n" << "Computes the area from width and height\n" << "\nUse -h to show help\n"; } int main( int argc, char** argv) { if ( argc < 3 ) { showUsage(argv); return 1; } unsigned short int Width = stoi(argv[1]); unsigned short int Length = stoi(argv[2]); // create an unsigned short and initialize with result // of multiplying Width by Length unsigned int Area = (Width * Length); cout << "Area: " << Area << endl; return 0; }
Anonymous
this is my first
Edurolp
http://www.gnu.org/software/libc/manual/html_node/Getopt.html
okey the code i had is the examples from here but with spanish comments 😆
Edurolp
just try to understand the examples from gnu
Edurolp
they are quite basic
Anonymous
thanx
Anonymous
i undersand a little spanish
Edurolp
also after the examples you can see examples of outputs depeding on the input from commandline
Edurolp
here you have a folder with the examples
Anonymous
wow thank you very much
Edurolp
you are welcome :)
Top T : Trollface Was Real
cel 🌻
ohh you are in this group as well1
Top T : Trollface Was Real
Top T : Trollface Was Real
You're welcome here)
cel 🌻
i joined this group is mainly to gain exposure
cel 🌻
hahahaa
Top T : Trollface Was Real
ENOENT
i joined this group is mainly to gain exposure
good luck getting exposed to anything in this group... :D
Anonymous
how would you check for loss of data due to type casting? in c++
ENOENT
when? compile time or run time?
Anonymous
compile time
ENOENT
probably a compiler warning option
Anonymous
Anonymous
how would i check for data loss ?
Evgenii
how would you check for loss of data due to type casting? in c++
The best thing I can't think of is to define own cast
Anonymous
https://youtu.be/XXyY8X6WmTk
@DevPGSV
I didn't find info about that video.
Anonymous
hilarious
correctmaninwrongplace
Hey , im trying to overload the » istream operator
correctmaninwrongplace
to read a word , not a string , how could i do that?
Eu
inherit from istream, then overwrite that method
Eu
would it work for you?
Edurolp
what you mean with a word and not a string?
Eu
oops, but istream operator >> default delimiter is blank, so you are already reading word-by-word basis, isn't?
ENOENT
good luck getting a response from the admin :D
ENOENT
so, you are 1337 kali haxxors
ENOENT
but can you type ls -l
Anonymous
Nelson Mandela: How does one interchange the keyboard function of a pc
Roxifλsz 🇱🇹
but can you type ls -l
>tfw aliased ls to ls -l
ENOENT
not ll la etc?
ENOENT
that's the usual convention
ENOENT
I hate how everything scrolls when you use ls -l
ENOENT
plus it's way to much info
Anonymous
It doesn't matter if you announce another hacking group
Anonymous
But needs to be hacking or programming group, not cooking or fucking group
Ricardo Arturo
ls -hal
ENOENT
ls -hal
I'm sorry dave, I can't let you do that
Ricardo Arturo
😔
Edurolp
could you please send more spam please? 😆
Ricardo Arturo
delete your spam
Ricardo Arturo
Does it have anything to do with c or c++?
Anonymous
Don't abuse of this
ENOENT
maybe you could try to write in a way we can read
ENOENT
also maybe you yould try not sending 20 messages related to your wannabe kali group into a C++ group every hour
Anonymous
Go out with the problem
Roxifλsz 🇱🇹
Yes, be afraid, he uses the ultim8 haxx00r distro called teh kali loonix!!!
Anonymous
in c++ whats the most direct way of testing for parts of a string?
Anonymous
lik in python i can use myarray[1:5] for example
Anonymous
to test for myarray[1]-myarray[5]
Eu
String comparison, character searching...?
correctmaninwrongplace
Strcmp from cstring if you use char*
Eu
if you know for sure that your string is at least 1 char long, you could use strncmp(your_str, other_str, 4) for comparison, strnchr(your_string, your_char_searched), strnpbrk...
Eu
oops, I read plain C, don't know why 😅 Then is better to stick with std::string interface :)
Eu
they are less error-prone
Anonymous
is C++ supposed to be big files, im very new to c++ but my program does very little and is 14K
Anonymous
im used to x86asm
Anonymous
all it does is handle two flags and print out a few lines it just seem like a huge file
ENOENT
is C++ supposed to be big files, im very new to c++ but my program does very little and is 14K
not really... it depends on what you tell your compiler and what constructs you use
ENOENT
I never cared about size but I heard templates use a lot of space
Anonymous
https://paste.pound-python.org/show/ErtQPndtTdfzjfJpDakl/