Ok, I just wanted to ask if there's some easier to way to do it :) Thanks! I'll try! :)
Type: Posts; User: Tehy
Ok, I just wanted to ask if there's some easier to way to do it :) Thanks! I'll try! :)
The order need to be a, t, d because that's the only way to get the right format to the file. For example: ./d -a -t 2007-07-27 -d "something" writes 001;2007-07-27;Something to the file. So if the...
Ok, I still can't really find the answer to my original question. I have for example situation:
while ((c= getopt (argc, argv, "atd:")) != -1)
switch(c) {
case a:
write something to...
hmm, I'm not familiar with getopt_long()... Any good site where I could find how it works? Of course someone can explaine it here :)
I'm creating little comman line app and I'm using getopt to parse the command line arguments. Now i'm trying to find the best/easiest way to check if the arguments are valid...
what I mean is. My...
oh, thanks! :)
Here the code:
#include <stdio.h>
#include <time.h>
int main (void) {
time_t ctime = time(NULL);
char c [10];
Thanks a lot! I will try these out! :)
I just coded number pyramid:
#include <stdio.h>
int main (int argc, const char * argv[]) {
int i, j, k, l;
int number = 0;
l = 1;
Thanks swoopy, but I still get the bus error and compiler says that the problem is here if (*argv[1] == '-')
thanks, I will :)
oh, ok I'm just learning how to use command line arguments :)
#include <stdio.h>
#include <string.h>
int main (int argc, char * argv[]) {
int i, j, k;
if (*argv[1] == '-') {
if (*++argv[1] == 'l') {
here's one idea:
#include <stdio.h>
int main() {
int c, i ;
Hi ION!
Like people already said, you can't use gets() when you are reading numbers. I recommend you to use scanf(). here's the working version of your app:
#include <stdio.h>
int main()...
Hello all coders! I'm trying to creat menu and it almost works perfectly but there is one problem. When user for example inputs char (asfgdahdh) my menu goes in endless loop. Here's the code:
...