Search:

Type: Posts; User: Tehy

Search: Search took 0.00 seconds.

  1. Ok, I just wanted to ask if there's some easier...

    Ok, I just wanted to ask if there's some easier to way to do it :) Thanks! I'll try! :)
  2. The order need to be a, t, d because that's the...

    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...
  3. Ok, I still can't really find the answer to my...

    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...
  4. hmm, I'm not familiar with getopt_long()... Any...

    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 :)
  5. the best way to check if command line argumets are valid

    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...
  6. Replies
    3
    Views
    963

    oh, thanks! :)

    oh, thanks! :)
  7. Replies
    3
    Views
    963

    Trying to print day

    Here the code:


    #include <stdio.h>
    #include <time.h>

    int main (void) {
    time_t ctime = time(NULL);
    char c [10];
  8. Thread: Number pyramid

    by Tehy
    Replies
    7
    Views
    4,657

    Thanks a lot! I will try these out! :)

    Thanks a lot! I will try these out! :)
  9. Thread: Number pyramid

    by Tehy
    Replies
    7
    Views
    4,657

    Number pyramid

    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;
  10. Thread: strange bus error

    by Tehy
    Replies
    8
    Views
    1,504

    Thanks swoopy, but I still get the bus error and...

    Thanks swoopy, but I still get the bus error and compiler says that the problem is here if (*argv[1] == '-')
  11. Thread: strange bus error

    by Tehy
    Replies
    8
    Views
    1,504

    thanks, I will :)

    thanks, I will :)
  12. Thread: strange bus error

    by Tehy
    Replies
    8
    Views
    1,504

    oh, ok I'm just learning how to use command line...

    oh, ok I'm just learning how to use command line arguments :)
  13. Thread: strange bus error

    by Tehy
    Replies
    8
    Views
    1,504

    strange bus error

    #include <stdio.h>
    #include <string.h>

    int main (int argc, char * argv[]) {
    int i, j, k;


    if (*argv[1] == '-') {
    if (*++argv[1] == 'l') {
  14. Replies
    12
    Views
    3,719

    here's one idea: #include ...

    here's one idea:




    #include <stdio.h>

    int main() {

    int c, i ;
  15. Thread: help plz

    by Tehy
    Replies
    11
    Views
    1,318

    Hi ION! Like people already said, you can't...

    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()...
  16. Replies
    2
    Views
    1,893

    Creating menu, problem

    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:



    ...
Results 1 to 16 of 16