Search:

Type: Posts; User: lmanukyan

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. john.c, sorry. i guess it was too early in the...

    john.c, sorry. i guess it was too early in the morning for me to read carefully.

    i just read it again and it makes sense now :D and also works and, so thanks!

    but what i'd like to do is not to...
  2. thanks for the suggestions. it seems logical...

    thanks for the suggestions.

    it seems logical to me but this code doesn't even display one console. i tried to get an input from the function that creates/deletes the console but it won't even stop...
  3. having two console windows in c++ application

    as the title suggests, i need to have 2 separate console windows in my application. one should be the "main" console, and the other should be an independent one that has its own inout and output...
  4. With strtok I guess I could assign char*'s to...

    With strtok I guess I could assign char*'s to array of ptrs, but I should define a whole list of delimiters so its not convenient. And no, everything is not space separated.
  5. well, the user input is a math expression, so i...

    well, the user input is a math expression, so i wanna separate the numbers and the operations, like this:


    char* a[] = {"566", "+", ...}
  6. extract numbers from char array into array of pointers

    i need to extract numbers from user input. i think it's best to extract them into array of pointers because in that case i can refer to the numbers with their index.

    i can't assign an int (which...
  7. okay i did that. is this how it should look like?...

    okay i did that. is this how it should look like?

    14631

    i tried to read these data from file with another code and it printed the correct account number and balance, as i inputted (and not...
  8. Writing Data Randomly to a Random-Access File

    just trying to run and understand this example from the book. the code compiles and runs correctly but i get weird results in the file. the account number i enter appears as a symbol in file, and the...
  9. Replies
    1
    Views
    1,107

    srand time null

    i generate a random number is in a function other than main, and the result of this function is sent to main. in which function(s) should i write srand(time(NULL))?
  10. Replies
    6
    Views
    1,116

    i made some changes and got this, it actually...

    i made some changes and got this, it actually works but only after the second time i enter a valid number. i.e. i enter 0, it says "enter 0,1,2,3,4" then i enter 0 and only then it works, same for...
  11. Replies
    6
    Views
    1,116

    yeah i copied and forgot to change the name :D ...

    yeah i copied and forgot to change the name :D

    and how do i limit the choice to be a number? i wrote this but it creates an infinite loop. where in code stop it?




    while (choice < 0 ||...
  12. Replies
    6
    Views
    1,116

    array of pointers to functions

    #include <stdio.h>
    #include <conio.h>


    #define STUDENTS 4
    #define EXAMS 5


    void printArray(int [][EXAMS], int, int);
    void minimum(int [][EXAMS], int, int);
  13. Replies
    5
    Views
    1,118

    In an online compiler the code worked. I...

    In an online compiler the code worked.

    I included <string.h> library, maybe I should add anything else?

    P.S. strcat, strncat don't work either (print null as a result)
  14. Replies
    5
    Views
    1,118

    strcpy results null

    int main() { char x[] = "Happy Birthday to You";
    char y[25];
    char z[15];


    printf( "%s%s\n%s%s\n",
    "The string in array x is: ", x,
    "The string in array y is: ",strcpy_s( y, x...
  15. Replies
    1
    Views
    620

    string conversion strtol function

    int main() {
    const char *str="-1234567abc";
    char *PTRremainder;
    long x;
    x = strtol(str, &PTRremainder, 0);
    printf("The string \"%s\" to long is: long %ld and string is %s, x+3 is...
  16. Replies
    3
    Views
    700

    I just started learning pointers to functions,...

    I just started learning pointers to functions, and I can't say I understand everything clearly, so a little help would be appreciated.
  17. Replies
    3
    Views
    700

    array of pointers to functions

    Can someone please explain me how to use an array of pointers to functions with some basic or middle level examples? How do I know when I should use it?

    EDIT: also pointers to functions.
  18. Replies
    10
    Views
    1,909

    Like thiS? void someFunction(int *ptArr,...

    Like thiS?



    void someFunction(int *ptArr, int *(ptArr + SIZE-1)); // assuming SIZE has been defined
  19. Replies
    10
    Views
    1,909

    And how do i.pass this pointer to thr end of the...

    And how do i.pass this pointer to thr end of the array to the function???
  20. Replies
    1
    Views
    1,027

    bubble sort (call-by-ref)

    1 /* Fig. 7.15: fig07_15.c2 This program puts values into an array, sorts the values into
    3 ascending order, and prints the resulting array. */
    4 #include <stdio.h>
    5 #define SIZE 10
    67
    void...
  21. Replies
    10
    Views
    1,909

    Well, I wrote this: int main() { int...

    Well, I wrote this:



    int main() {
    int a[10];
    int *pt1 = a; // a pointer to the beginning of the array, i.e. a[0]
    int *pt2 = &a[9]; // a pointer to the end of the array, i.e....
  22. Replies
    10
    Views
    1,909

    I'm a little bit new to addresses and pointers....

    I'm a little bit new to addresses and pointers. I'm trying to remember what I know but I can't really figure out why you mentioned the &. Well, if we know the type of the elements of array and the...
  23. Replies
    10
    Views
    1,909

    pointer to the end of an array

    int a[10];
    int *p = a;


    p is the same as &a[0].

    how to write a pointer that points to a[9] (i.e. the last item of the array)?
  24. Replies
    1
    Views
    949

    incrementing a pointer

    void printCharacters( const char *ptStr ){
    for( ; *ptStr!='\0'; ++ptStr) {
    printf("%c",*ptStr);
    }
    }


    In this function ptStr points to a char, and char is 1byte, so ++ptStr means...
  25. Replies
    1
    Views
    484

    a question about a job

    Hello guys. I have a question to those who have or had an experience of job in the field of programming in C/C++ or, in generally those who can help me. I'm learning C with Deitels' "C: How to...
Results 1 to 25 of 82
Page 1 of 4 1 2 3 4