User Profile

Collapse

Profile Sidebar

Collapse
keerthiramanarayan
keerthiramanarayan
Last Activity: May 7 '10, 09:44 AM
Joined: Nov 20 '07
Location: Bangalore
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • keerthiramanarayan
    replied to How to convert alphabet to numbers?
    in C
    If you know the ASCII standard then you know that 'a' has value 65. Now if you want to print out your code for 'a' as 01 then you have to subtract your character first by 65 and then add 1. effectively code of 'b' is ASCII(b) - ASCII(a) +1,
    ASCII(b) = 66
    ASCII(a) = 65

    Therefore ASCII(b) - ASCII(a) +1 = 2.

    Next you get to coding. The following snippet considers that the value for the character is only between...
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to Initialization list
    in C
    I too had the same doubt. However I tried it out and it seemed to work fine. I made the following observations though. The order of execution of the function is not defined. This is compiler dependent. Next thing is that the function should generally not be a instance member function, since we cannot count on the object to be completely initialized.

    Consider the following code:

    [code="c++"]
    class TestClass...
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to function should have a prototype
    in C
    I repaired the code to this and it works fine. (on VC and gcc atleast). This avoids the name clash problem as pointed out above. The
    Code:
    using std::cout;
    also makes sure that you don't go around typing std:: each time you use the function/class

    Code:
    #include <iostream>
    #include <string>
    
    using std::string;
    using std::cin;
    using std::cout;
    ...
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    started a topic Query on Using XML file for Database
    in .NET

    Query on Using XML file for Database

    I wanted to create a small blog component for a website using C#. I do not have
    MSSQL. So i thought i would use a xml file as a database. I also created the xsd and linked it to the xml. Is it a good choice to use a xml instead of a database. Updates are very rare. Presently i am able to load the xml into a dataset and search through it. How do i update new data? Also at what frequency should i update the data file?
    See more | Go to post

  • keerthiramanarayan
    replied to C String Comparison
    in C
    should be replaced by
    [code=cpp]
    if(strncmp(text ,"quit",4) == 0){
    [/code]...
    See more | Go to post

    Leave a comment:


  • Hi,
    I happened to use libpcap for a prototype of a packet forwarder. As far as i know, the libpcap library can capture any packet which comes to your MAC (Network Card). But one exception i noticed was that libpcap does not capture packets that originate and are destinated for the localhost (loopback). Guess u can use any of the tools that use libpcap (wireshark etc.) to find out if it is really what u want to use....
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to function should have a prototype
    in C
    I would like to add to the above reply. You should refrain from using the .h when including standard c++ libraries. So preferably use
    [code=cpp]
    #include <iostream>
    [/code]

    instead of
    [code=cpp]
    #include<iostre am.h>
    [/code].

    You have used the notation for string but have not done so in the case of iostream....
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to i wanted C Program
    in C
    Thanks Jos. I will be more carefull while using recursion next time :)...
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to File Handeling Problem In C++
    in C
    First of all i would ask you to see the Posting Guidelines.

    Coming to the solution, do you really require a class for something that holds only data. You would be better off storing the data as a structure. Next, to support portability and easy retrieval, it would be better if you wrote each member separately into the file. The runtime may arrange each type differently and cause problems. Try writing(reading ) each field separately...
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to i wanted C Program
    in C
    Such Programs can be easily specified using Grammars and can be converted to C Programs using Lex and Yacc. However for the specific purpose of matching braces, i doubt if your algorithm will work for all cases. The best way to tackle the matching program is by recursion. Enter when you get the left brace and leave when you get the right brace.
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to C++ help address book
    in C
    From what i can make out you do not have a function which iterates through the list and finds the name.
    For such a function you would need how many records you read from the file (missing in your code). You can return the count from the function.
    Secondly you need to include the following code in a for / while loop...
    See more | Go to post

    Leave a comment:


  • The map in your case will be initialized to 0.00 . However it is not the case with types such as strings or user classes. which tend to by null(0). So you should be careful.
    See more | Go to post

    Leave a comment:


  • keerthiramanarayan
    replied to C++ help address book
    in C
    Hi,
    It would be easy to reply to your query if you specified the structure of address book.

    I will explain considering that your addressbook entry contains the data in the following format
    <First Name> <Last Name> <Phone Number>.

    You would be greatly helped by creating a structure that holds the data that you read from the file as follows.

    Code:
    #include <string>
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...