CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: chiragrr

Page 1 of 2 1 2

Search: Search took 0.03 seconds.

  1. Thread: Array Usage

    by chiragrr
    Replies
    23
    Views
    2,835

    Re: Array Usage

    Also teaches you debugging ;)
  2. Replies
    8
    Views
    1,262

    Re: help me please

    Dude read up on loops for. Put the for (;;){ before cout<<"please enter.... " and then put the ending brace before System Pause call
  3. Replies
    0
    Views
    1,862

    HMAC hash in C/C++

    Hey Guys,

    I am looking for some help on how to get a HMAC hash for a string s using key k.

    I found this(http://www.hmug.org/man/3/HMAC_Init.php) but I have no idea how to use it. Any pointers...
  4. Replies
    7
    Views
    1,142

    Re: reading files in C++

    I think you need to understand .doc headers as mentioned by 7sutd
  5. Replies
    13
    Views
    68,505

    Re: How to use timer in Unix ?

    1) Put "sleep 300" in the perl file and run it infinitely
    2) Use shell script and use that

    These two are easier than C program. C++ - Never reinvent the wheel
  6. Replies
    1
    Views
    1,044

    Re: Guessing Game - Following the rules!

    A few problems
    1) You have created an integer array of 150 and but if I chose a number between 0 and 1000000 it could take me more tries. This is assuming I do not use binary search
    2) You never...
  7. Replies
    2
    Views
    816

    Re: how to check if server is up?

    Depends on the firewall config on the server. You can do a TCP open on a known port but other than that I am not sure how to check whether the server is up and running.

    If you are on a broadcast...
  8. Replies
    1
    Views
    693

    Re: Reading .dat with multiple structures

    My recommendation is that you are wasting too much space for the unused characters.
    1) Switch to using string instead of char array
    2) At the end of each entry put in a special character. seekg...
  9. Thread: Confusion++

    by chiragrr
    Replies
    16
    Views
    2,073

    Re: Confusion++

    Just use




    ifstream infile ("Filename");
    string name[10];
    int marks[10],i;
    if (! infile.is_open())
    {
  10. Replies
    5
    Views
    3,282

    Re: C++ compiler issue

    Sorry about being less ignorant while posting. Anyways I figured out the issue and thanks for taking the time out to respond. Henceforth I will make sure that I follow the guidelines
  11. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    In short there is not optimal way of doing things here ;)
  12. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    I agree with Lindley here. You can read the file with the censored words into an array or a Vector (safer option)
  13. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    You can actually create a Vector of a struct


    struct words
    {
    string word;
    int pos;
    };
  14. Replies
    5
    Views
    3,282

    C++ compiler issue

    I am trying to compile my program but am getting what I think are linker/compiler issues

    chiragr@irrawaddy uname -a
    Linux irrawaddy 2.6.23.8 #6 SMP Wed Nov 21 14:18:12 PST 2007 i686 AMD...
  15. Replies
    3
    Views
    943

    Re: Tips on getting C++ experience?

    Start redoing your Java stuff in C++ nothing different nothing new. This would mean you would end up spending less time defining and understanding the problem and more time on C++
  16. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    You can do the same by the following


    //GLOBAL DEFINITION
    int ast_length=0;
    char *ast;


    //WITHIN THE LOOP
    {
  17. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    read up on how to read and write binary files reading seekp/seekg and tellp/tellg
  18. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    #include <iostream>
    #include <iomanip>
    #include <fstream>
    #include <string>
    using namespace std;

    int main()
    {

    string x;
  19. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    ditto and close to the same time as well :D
  20. Replies
    36
    Views
    3,650

    Re: Editing a single word in a file

    Its going to be easier to debug this using gdb or any other tool that you use. I would say the worst case once you have read both the strings print them to check the contents. This would then give...
  21. Re: Having trouble with program that reads and prints arrays

    I agree but what about the case where two distinct entries have the same number of votes which is equal to max votes.

    If its only about printing values then it can be void function. If you need...
  22. Re: Having trouble with program that reads and prints arrays

    I think you can achieve this in the same function as read.

    Initialize two more variables


    int maxvotes=0;
    string max;
    while(!inStream.eof())
    {
    inStream >> name;
  23. Replies
    4
    Views
    2,367

    Re: winsock sending array..

    If its a \0 terminated string you could use send (socket, array,strlen (array),...)
  24. Replies
    1
    Views
    812

    Re: C++ compiler issue

    I would like to add that instead of

    #include "/usr/include/sys/types.h"
    #include "/usr/include/sys/socket.h"

    I originally had
    #include <sys/types.h>
    #include <sys/socket.h>
  25. Replies
    1
    Views
    812

    C++ compiler issue

    I am trying to compile my program but am getting what I think are linker/compiler issues

    chiragr@irrawaddy uname -a
    Linux irrawaddy 2.6.23.8 #6 SMP Wed Nov 21 14:18:12 PST 2007 i686 AMD...
Results 1 to 25 of 26
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured