User Profile

Collapse

Profile Sidebar

Collapse
primeSo
primeSo
Last Activity: Sep 20 '10, 05:39 AM
Joined: Aug 21 '07
Location: Malaysia
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Maximum buffer size of an odbcTransaction object in .NET 4.0

    Hi all,
    I am developing a Web Service application on .NET 4.0. with VB.NET. using System.Data.ODB C as the data connector to Oracle 10G database.

    Somehow i need to perform some updating and insertion of accounts information by batches into database. Thus, i used an odbcTransaction object to commit or rollback the updating/insertion in batches as well. In some scenarios, i would be having about 1000 SQL statement in a single...
    See more | Go to post

  • primeSo
    replied to Sorting Multiple Vectors
    in C
    Just my personal opinion.

    I think you have some miss understanding with what your code is doing compare to what you actually wanted it to do.

    First of all, you have wroteyou have 3 vectors which store first name, last name and score respectively. Then you wanted them to be sorted by last name.
    After your sorting operation, what is sorted is only the vector storing the last name, the other two still remain the...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Common mistakes that trapped me always!
    in C
    haha, i think i am almost there. thank you. I always forgotten the concept of "a copy of the actual parameter, NOT the actual parameter itself". Thank you.

    Just one more point to go, let's say those statements in my example are being done in one main(), i didn't so any function calling, then intArray++ is totally wrong. My GCC compiler complainted "Wrong Type Of Argument to Increment". : )

    intArray++...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Common mistakes that trapped me always!
    in C
    Hm... i am sorry. Don't get what you mean. : )...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Common mistakes that trapped me always!
    in C
    Array name is a constant pointer. So, how can we do pointer arithmetic on array name like intArray++ at the first place? This statement is equivalent to intArray += 1.


    What does the "assigned" meant? We cannot change the value contained by array name, am i correct ? IT ALWAYS POINTS TO THE FIRST ELEMENT IN THE ARRAY. but how could intArray++ works at the first place? it is changing the value of intArray....
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Common mistakes that trapped me always!
    in C
    Thank you for the site, it has cleared most of my doubt. : ) . Let me clarify again with i have understand so far.



    Result of these statements: 12345.
    *(intArray + i) == intArray[i], I am pretty sure with this.



    Let's do some desk check.
    When i = 0, print: 2
    i = 1, print: 3
    i = 2, print: 4
    i = 3, print: 5
    ...
    See more | Go to post

    Leave a comment:


  • primeSo
    started a topic Common mistakes that trapped me always!
    in C

    Common mistakes that trapped me always!

    I did C in UNIX environment. These are some of the common mistakes that always trapped me in my work. I need help from you guys to clarify them with me.




    1)[CODE=c]
    int intArray[5] = {1,2,3,4,5}, i;

    for(i = 0; i < 5; i ++){
    printf( "%d", *(intArray + i) );
    }
    [/CODE]
    As we know, array name ,intArray is a constant pointer, it always point to the...
    See more | Go to post

  • primeSo
    replied to Köll & Sam Classroom Blog
    in Java
    @@ oh....thanks. : )



    haha, sure. Good luck and cheers ~~ : )...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Array of Structure
    in C
    You declare a global array of type MyStr which consists of 3 elements. But you pass them as below
    Code:
    GetBuffer(&MyStrPointer, &numseq);
    is it correct? this mean "pass the address of the memory location which point to the first element of the array? hence, you need to use two * (
    int GetBuffer(MyStr **SSPtr, int *size)) to receive them in the called function ? I thought we need to pass the name of the array only when...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Array of Structure
    in C
    I have some doubts after reading through your program, i would like to point them out here to gain some clarification from you all.

    1) Line 21 & 24
    You declared a integer variable, numseq but didn't initilialize them, is it alright in the context of C programming? i thought we should always initialize any variable in C before we use them, in this case you pass the variable by reference to a function.

    2) Line...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Program with the spaces in C
    in C
    First of all, you must make it very clear between "string" and "character" in C.
    This two have distinctive differences.

    For example: "qwe qwe qwe" is a string with 3 "WORDS". Each word consists of 3 CHARACTERS. These 3 WORDS form a STRING in C. And the words is deliminated by a SPACE. THIS IS THE FUNDAMENTAL KNOWLEDGE.

    The problem you mentioned is a common buffering bug...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Using wtatic variables across multiple files?
    in C
    You mean you want to use the same variable across different soruce file and its value must be preserved? You didn't specfy C or C++. I assume you mean C. Technically, yes.

    The easiest way is to use global variable but it is not advise to use global variable. check it out yourself. And you need the keyword " static" to make its value contained in the variable preserved by the program. Checks the "variable scope"....
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to does scanf recognizes space as character?
    in C
    yes, use space prior to your format string. ie. scanf(" %d", &num); will ignore any preceeding white space until it hit a non-white space input...
    See more | Go to post

    Leave a comment:


  • Please do some reading yourself regarding <ctype.h> library function. There are some function which can check the input type for you i.e. decimal number, float , character etc.

    Second option, write a function yourself that check each input from buffer, which get input from standard input device like keyboard.

    There are other ways to do this as well, for example checking ASCII code for the input enter from keyboard...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Segmentation Fault
    in C
    Passing 2-D array to a function. I think you need to check it out yourself.

    I don't think you need to specify the 1st dimension in the calling function, which u mentioned u passed in to the function. The compiler would just ignore it , the important one is the 2nd dimension. Segmentation fault might be encountered due to the improper passing of argument to your function which then access those memory location that you are not allow...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Köll & Sam Classroom Blog
    in Java
    I will start to learn JAVA on the coming January! yeah ..JAVA here i come ^.^
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to How to read single line from a file?
    in C
    Please do some reading before your ask such question.

    However, i can give you some hints on this. Use fgets(), fread() etc
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to deleting part of file and modyfing it
    in C
    I didn't go throught your code in detail, but roughly know what you want to do.

    First of all, for efficiency wise, i want to advice you to pass in the pointer of the structure to the function instead of passing the whole structure one at a time. check this out.

    Do you mean that you want to update the value of the variables within your structure? use dot "." operator or "->" short hand operator...
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to error in the output file
    in C
    You are more welcome ^.^

    For your knowledge wise, scanf() and fsanf() will get every input from your buffer untill it hit the first white space character (tab, new line, space etc), thus, if your enter an string which consists white space as your mentioned, fscang() only accepts the first word ie "my" only.. there is two ways to resolve this problm

    1. use "%[^\n]" in your format string argument i.e....
    See more | Go to post

    Leave a comment:


  • primeSo
    replied to Arrays Question
    in C
    fgets() used wrongly, in your case, the last argument is wrong. Try to change it to STDIN. Check it out.

    what do you want to do with the file pointer i.e file? are you sure what you are doing will achieve what you expected? do some reading dude. ^.^...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...