Search:

Type: Posts; User: modec

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: fork problems

    by modec
    Replies
    1
    Views
    1,280

    fork problems

    I have written the following.


    #include <stdio.h>
    #include <unistd.h>
    #include <stdlib.h>

    int main(void) {
    int i, pid;
    pid = fork();
  2. Replies
    3
    Views
    3,137

    just forget the last post. i used "new" and...

    just forget the last post. i used "new" and member pointers and now it works smooothly.
  3. Replies
    3
    Views
    3,137

    int main () { list mlist; Member...

    int main ()
    {
    list<Member *> mlist;
    Member memtest;
    Employee emptest;
    int ans;
    string buf;

    cout << "What do you want to put?" << endl
    << "Member (1) - Employee (2) ? : ";
  4. Replies
    3
    Views
    3,137

    problem with pointer to object and STL list

    #include <iostream>
    #include <string>
    #include <list>
    using namespace std;

    class Member {
    string name;
    public:
    Member(string name) {
    this->name = name;
  5. Replies
    3
    Views
    856

    string destructor

    In a class i have many string (#include <string>) variables. In the destructor do i have to do anything special for the string? i tried delete name_of_string and the compiler complains that delete...
  6. Replies
    4
    Views
    1,076

    struct with struct

    letdef struct list_tag * list;

    struct list_tag {
    enum {
    .....
    } kind;
    struct {
    int x;
    struct {
    int y;
  7. i m working with six header files and six source...

    i m working with six header files and six source files, thats why i couldn't post it all. I was hoping for a short easy answer. it must be a scope thing which i can't sort out.
  8. first of all it is a valid struct Type_tag...

    first of all it is a valid struct Type_tag object. secondly i put the ... in the next line and i get the error on the line where the (symbolentry->type) is
  9. typedef struct Type_tag * Type; struct...

    typedef struct Type_tag * Type;

    struct Type_tag {
    enum {
    TYPE_unit,
    TYPE_bool,
    TYPE_char,
    TYPE_int, ...
  10. struct "dereferencing pointer to incomplete type"

    I have the following declarations:



    typedef struct SymbolEntry_tag * SymbolEntry;

    struct SymbolEntry_tag {
    Identifier id;
    Scope scope;
    ...
  11. Replies
    6
    Views
    1,999

    or you can use if if (x < 0) x...

    or you can use if


    if (x < 0)
    x = -x;

    or


    x = (x > 0)? x : (-x);
  12. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    If you type tab the compiler will see the ascii...

    If you type tab the compiler will see the ascii character 9. that's how he can distinguish between the two.
  13. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    ok i got it. I was thinking of a tab as many...

    ok i got it. I was thinking of a tab as many spaces. But printf doesn't print many spaces, it moves to the next tab stop. So i was thinking that printf makes a mistake when it prints a single...
  14. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    i used gdb to debug. Hardware access...

    i used gdb to debug.



    Hardware access (read/write) watchpoint 3: yytext

    Value = 0x93c70 "'\t'"
    0x00003c38 in main () at lexin.c:107
    107 printf( "token = %d, lexeme =...
  15. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    i m using flex to write the lexical analyser and...

    i m using flex to write the lexical analyser and i have the following prob:
    this code


    //other stuff for flex

    int main ()
    {
    int token;
  16. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    ok, i know about the escape sequences \n \t \r...

    ok, i know about the escape sequences \n \t \r etc. But i m asking: considering that newline is a single character is the following acceptable?


    char c = '
    ';

    the reason i m asking is because...
  17. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    i didn't catch your post itsme86. It is probably...

    i didn't catch your post itsme86. It is probably the devc++ editor's fault. is the newline considered a single character?


    c = '
    ';
  18. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    thanks for the replys. i tried the same code (the...

    thanks for the replys. i tried the same code (the one i posted) in cygwin (gcc) and the output was :
    "a a" (a [tab] a). can anyone explain why this difference?
  19. Thread: printing a tab

    by modec
    Replies
    16
    Views
    51,570

    printing a tab

    #include <stdio.h>

    int main()
    {
    char c = ' '; /* I typed tab here */
    printf("a%ca\n", c);
    return 0;
    }
  20. Replies
    5
    Views
    2,007

    thanks everyone. itsme86 the function is exactly...

    thanks everyone. itsme86 the function is exactly the same for the two types and using long for both long and char inputs works just fine.
  21. Replies
    5
    Views
    2,007

    multiple input type

    Can you have a function that has an argument that could be either one type or another. For example foo(x input) where x is either char or long int? should i look into enums?
  22. Replies
    1
    Views
    1,758

    program that prints itself

    I guess someone has heard of the programs that when executed print their code like this one :


    #include <stdio.h>

    main()
    {
    char*p="main(){char*p=%c%s%c;printf(p,34,p,34,10);}%c";
    ...
  23. Thread: gtk dev c++

    by modec
    Replies
    0
    Views
    1,826

    gtk dev c++

    I'm trying to install gtk for devc++. I have downloaded two files gtk-runtime.exe and gtk-dev.zip. Could someone tell me what to do with those files? Documentation hasn't helped me, i tried several...
  24. Replies
    10
    Views
    5,476

    #include int getch(); FAQ...

    #include <conio.h>

    int getch();

    FAQ
  25. Thread: read characters

    by modec
    Replies
    2
    Views
    1,553

    read characters

    is there a way to read input from the keyboard while the user enters it. before he presses return.
Results 1 to 25 of 37
Page 1 of 2 1 2