Search:

Type: Posts; User: looza

Search: Search took 0.01 seconds.

  1. Thread: strings

    by looza
    Replies
    1
    Views
    661

    strings

    I am trying to read in a string from the command line, copy it to another and then print it out character by character in the following code. I get a segfault when I use 'exp[i]'. Any ideas why, and...
  2. Replies
    2
    Views
    1,481

    That helps, Thank you so much!

    That helps, Thank you so much!
  3. #include int main() { int...

    #include<stdio.h>
    int main()
    { int num[3]; /*Sets array to 3*/
    int count;
    char c;
    printf("Enter a 3 numbered integer:");
    for(count=0; count<3; count++){ ...
  4. Replies
    2
    Views
    1,481

    Reading from file with specific widths.

    Hello,

    I have an input file that has 3 columns. The first column includes alphanum special characters and spaces as well. It looks like this:




    @ED#@ 11 AAA
    !@ R$ 22 BBB
    !@EDF 33...
  5. Replies
    4
    Views
    2,478

    Thanks Quzah, This code segfaults :-( ...

    Thanks Quzah,

    This code segfaults :-(





    typedef struct mystruct{
    char mychar [5][4];
  6. Replies
    4
    Views
    2,478

    2D arrays and double pointers

    Hi All,

    The following code prints out values of a 2 D array in main as well as in the function printvalues. However, fd->mychar[i] = newptr[i]; throws an error. I understand that a ** myarray is...
  7. Replies
    0
    Views
    1,977

    MPI_Bcast quesion

    Hello all!
    I am getting started with MPI and I was trying to use MPI-Bcast to broadcast a structure to all the other processes from process 0. Obviously, it doesnt seem to work as expected. I dont...
  8. Replies
    4
    Views
    2,658

    Because I can have several hosts and I need to...

    Because I can have several hosts and I need to identify requests coming from each of them, so every request will have a unique id, based on what host it is coming from. This unique id will be used to...
  9. Replies
    4
    Views
    2,658

    String (hostname) to unique integer.

    Hey All,

    I need to convert a string (hostname) to an unique integer, much like how inet_addr(ip) converts the ip address to an integer.

    I was looking at some related posts and I am sure there...
  10. Replies
    8
    Views
    8,589

    Aargh!! ok. Thanks! :-) Remote media is cool!

    Aargh!! ok. Thanks! :-) Remote media is cool!
  11. Replies
    8
    Views
    8,589

    Thanks for your help tater. I guess it would help...

    Thanks for your help tater. I guess it would help to provide more details and the oversimplification of the problem description was a bad idea, apologies.
    Here is what really happens.

    in...
  12. Replies
    8
    Views
    8,589

    Thanks Tater, though with this, I cannot access...

    Thanks Tater, though with this, I cannot access the updated value from outside main in anotherfunction().

    I now have:


    typedef struct mystruct{
    int a;
    .........
    }mystruct_t;
  13. Replies
    8
    Views
    8,589

    Well thats how I started but I need to access the...

    Well thats how I started but I need to access the value of the element 'a' in subsequent functions as well, and hence * newstruct. If its not a pointer, the value is lost outside main. Isnt that how...
  14. Replies
    8
    Views
    8,589

    Pointer to structure element

    Hey All,

    I have a struct like so:



    typedef struct mystruct{
    int a;
    .........
    }mystruct_t;
  15. Replies
    2
    Views
    1,133

    Thanks! It works when I remove the O_DIRECT...

    Thanks!
    It works when I remove the O_DIRECT flag, but I need to use it, isnt there a way to use it with the flags?

    The reason to use open/read and not fopen and fread is that I need to use...
  16. Replies
    2
    Views
    1,133

    Random Reads to file...

    I have the following code to randomly seek inside a file and read (or write) that location. When I try to execute it for a 32 mb (1<<25) file using: ./a.out /dev/sda3 25, it gives the error: Error in...
Results 1 to 16 of 16