Search:

Type: Posts; User: uz_mz

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    637

    ok, then how about writing the entire column...

    ok, then how about writing the entire column (including A,B,C...so on) in each loop iteration? is this possible?
    example:
    A
    1
    6

    A B
    1 2
    6 7
  2. Replies
    4
    Views
    637

    formatting text file

    Hi,
    I am writing some data to a .txt file in a tabular form with headings:
    A B C D E

    In each loop iteration, i would like to increase the horizontal spacing (\t) in the string so that I can...
  3. Replies
    18
    Views
    2,425

    Ya, but does it hold for array of FILES also? As...

    Ya, but does it hold for array of FILES also?
    As in:

    FILES **fHandle;
  4. Replies
    18
    Views
    2,425

    sorry..my mistake..was a typo. Also, since I am...

    sorry..my mistake..was a typo.
    Also, since I am allocating memory for 1st dimension only,

    fHandle = (FILE**) calloc (4,sizeof (FILE*));
    and free it by:

    free(fHandle);
    I do not need to loop...
  5. Replies
    18
    Views
    2,425

    sorry it should be: fclose([fHandle[i]); Is...

    sorry it should be:

    fclose([fHandle[i]);

    Is this right?



    Then whats the correct way of calling fclose()?
  6. Replies
    18
    Views
    2,425

    @Elkvis: ya..but I need to open all files in...

    @Elkvis: ya..but I need to open all files in advance, then write them during processing and close them all when I exit the program(fclose and free memory in destructor). therefore, I open pFile[0],...
  7. Replies
    18
    Views
    2,425

    @all, I just realized that when I use an array...

    @all,
    I just realized that when I use an array declaration:


    char cfileName[20];

    it works fine.
    But I also need to use an array of strings. Therefore, I did the following:
    char**...
  8. Replies
    18
    Views
    2,425

    Because I want to open and write and close files...

    Because I want to open and write and close files dynamically.

    @grumpy: They are not in the same function.
  9. Replies
    18
    Views
    2,425

    skipped code: char cfileName[20]; for (int...

    skipped code:


    char cfileName[20];
    for (int i=0; i<4; i++)
    {
    sprintf(cfileName, "Signal_%d.pcm",i);
    fHandle[i] = fopen(cfileName, "ab");
    fclose(fHandle);
    ...
  10. Replies
    18
    Views
    2,425

    dynamic allocation of file* pointers

    I have written the following:


    FILE **fHandle;fHandle = (FILE**) calloc (4,sizeof (FILE*));

    /*-----open and write and close files (code skipped)-----*/

    free(fHandle);
  11. Replies
    4
    Views
    676

    @Matticus: ya..got it! thankss..

    @Matticus: ya..got it! thankss..
  12. Replies
    4
    Views
    676

    @grumpy: thanks for ur advice. But Iam unable to...

    @grumpy: thanks for ur advice. But Iam unable to add path along with the file name (as shown in my example above).
    How can I do it?
  13. Replies
    4
    Views
    676

    write data to multiple files

    I have following lines to write signals in binary mode:

    short sOut[256];
    if(1)
    {
    fHandle = 0;
    /* write the file in binary mode */
    for (i=0; i<3; i++) //loop along channels
    {
    for (k=0;...
  14. Replies
    1
    Views
    618

    using 'or' inside case arguments

    Hello,

    I would like to choose same case for multiple switch conditions.
    For example:


    switch(choice) //''if choice ==0 or choice ==1, chose same case''
    {
    case (0 || 1):
    {
  15. Replies
    2
    Views
    3,162

    installing this update fixed the problem! :-)...

    installing this update fixed the problem! :-)
    Download Details | Microsoft Connect
  16. Replies
    2
    Views
    3,162

    visual studio 'intellisense' problem

    Hi,

    This is not related to C-programming, but I think you guys being experts can help me on this. I use MS visual studio 2010. Since past two days, I realized that the 'Intellisense' feature of...
  17. Replies
    5
    Views
    754

    thanks a lot guys for your inputs..!!

    thanks a lot guys for your inputs..!!
  18. Replies
    5
    Views
    754

    setting 1D pointer to an array

    Hi,
    I have the following situation:


    void myFun(float *pfMyPtr)
    {
    float Val[] = {0.234, 0,432, 0.322, 0762, 0.984};
    pfMyPtr = Val;
    }
  19. Thread: pointer to bool

    by uz_mz
    Replies
    5
    Views
    8,196

    It compiles fine and works as desired too. But...

    It compiles fine and works as desired too.
    But When I set a break point, then I see the following:

    name value type
    bAct 0x01774ca8...
  20. Thread: pointer to bool

    by uz_mz
    Replies
    5
    Views
    8,196

    pointer to bool

    Can I do the following? Is it a good practice?


    bool *bAct;

    bAct = (bool*) calloc (2, sizeof(bool));
    for (i=0;i<2;++i)
    {
    bAct[i] = true; //initialize
    }
  21. Replies
    28
    Views
    1,958

    I assumed so because when I print out the result...

    I assumed so because when I print out the result after 'either ways' of assignment, B prints the same array as A.

    And also:

    &B[0] == &A[0];
    &B[1] == &A[1];
  22. Replies
    28
    Views
    1,958

    I mean when we are printing result after B=A...

    I mean when we are printing result after
    B=A and

    for (i==;i>2;++i)
    {
    B[i]=A[i];
    }

    We see that B has row elements equal to that of A (as desired) in both the cases.
    You said that for...
  23. Replies
    28
    Views
    1,958

    You said for every valid i, B[i] ==A[i], meaning,...

    You said for every valid i, B[i] ==A[i], meaning,

    B[0]=A[0];
    B[0]=A[1];

    isit right? then when we print out A and B after this step, the result is as desired with B[i]=A[i] as in:
    ...
  24. Replies
    28
    Views
    1,958

    I understand the points you made. Following...

    I understand the points you made.
    Following code demonstrates my question (please ignore freeing memory at the moment):

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

    int main()
    {
    ...
  25. Replies
    28
    Views
    1,958

    thanks all for ur valuable inputs. It was very...

    thanks all for ur valuable inputs. It was very helpful!
    I still have a small query. As I said in my previous post, When I set initially B=A; then there is a memory leak when I switch between the...
Results 1 to 25 of 32
Page 1 of 2 1 2