• Member Avatar for Banfa
    Banfa

    Began Watching Diging Inside the TCP/IP packets

    Hi there, I am working on signature based IDS, for this I have captured the TCP/IP traffic through Wireshark and got a pcap file, I want to extract some fields …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Diging Inside the TCP/IP packets

    libpcap is just the library that enables you to capture the network traffic, if the data you are capturing is not a protocol that WireShark already handles then your only …
  • Member Avatar for Banfa
    Banfa

    Began Watching Preprocessor directives

    I have written some code that contains a system to report error messages to error log file. I use a class structure to do this. However, some parts of the …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Preprocessor directives

    > Everything works fine if I use #include "Error_Handler.h" in the code. But #include "ErrorHandler.h" Typo in post or actual mistake? That said it would still help to see a …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Blackboard messaging

    This definately does not sound like the observer pattern (which is OK you never said that you were implementing that) since in the observer pattern the publisher (thing adding the …
  • Member Avatar for Banfa
    Banfa

    Began Watching Const methods to read private data members of a class

    I keep getting access violations even though I made sure to make all my methods and functions const! Driving me insane. When I add a player then try to display …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Const methods to read private data members of a class

    Your are deleting memory that is in use and you are mixing heap and stack memory and trying to delete stack memory, all in `Sport::add`. You are using dynamic arrays …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in having problems with getline()

    I supose it may be the compiler and it certainly wont hurt to use a more up to date one but from my recollection I would have thought the Visual …
  • Member Avatar for Banfa
    Banfa

    Began Watching having problems with getline()

    in response to an inclass exercise where the following question was possed: write a program using structures, which will capture a list of 10 movies, the data members should be …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in having problems with getline()

    Your code seems to work fine for me when I compiled it with MinGW after I commented out `#include "stdAfx.h"`. Note that "Visual Basic C++ 6.0" is not a thing …
  • Member Avatar for Banfa
    Banfa

    Began Watching Blackboard messaging

    Hi, I have a Blackboard object which is a singleton, what it does is store the message and the reciever. The challenge is that the blackboard will send an alert …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Blackboard messaging

    Subscriber::update, Subscriber::alter and Subscriber::noMessage all sound like they are doing the same thing and should be a single method. For the operation you want to perform you are missing an …
  • Member Avatar for Banfa
    Banfa

    Began Watching How to break out of main switch from a function?

    So basically I have: // FUNCTION double function(yadee_yada) if (input < 0) { return 0; } else { return something; //code } // END FUNCTION //MAIN int main { int …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in How to break out of main switch from a function?

    You will need code in your main function and you will need your other functions to return either a status or a sentinal value that can be tested in main …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Creating function template

    Like I said if you are having trouble with templates then start by working out how a normal function would work, then templatise it. So a function to print all …
  • Member Avatar for Banfa
    Banfa

    Began Watching Creating function template

    //Hi Lads.This is my first attempt to create template functions. //Here is the main ,which needed to create Locate.h file/header and //in that Locate.h create templates to support the main. …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Creating function template

    **Line 54** template<class T > T display_array(T ItemType[10] , T const int arraySize) This is invalid. Remeber that the compiler will substitude the type T in the template into the …
  • Member Avatar for Banfa
    Banfa

    Began Watching [c++ - win32] - using a callback on a class

    i continue with problems for use a callback function in a class member :( class Timer { private: typedef std::function<void(void)> timerprocedure; timerprocedure tmrprocedure;//can't be static int MilliSecondsTimer; bool blnDestroyed; UINT …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in [c++ - win32] - using a callback on a class

    This issue here is because MyTimerProc is static, and must be static to be passed to the C WIN API Function SetTimer it has no this pointer i.e. it does …
  • Member Avatar for Banfa
    Banfa

    Began Watching switch statement

    That program output (the chr is not a vowel ) everytime !! even if it's vowel #include <stdio.h> #include <conio.h> int main() { char ch; printf("Input a character\n"); scanf_s("%c", &ch); …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in switch statement

    My compiler does not support scanf_s (it's a Microsoft extension I think) but if I change your scanf_s to a scanf call it works as expected. So I looked up …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in shooting help

    Describe what you mean by not working? You already had everything in a loop, I think there is no need to add a second one.
  • Member Avatar for Banfa
    Banfa

    Began Watching shooting help

    my code is showing some problem, what i want it to do is that when the user hits space a ^ is shot from the position of the user and …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in shooting help

    I doubt it is compiling. Line 4: You have used assignment `=` when you meant to use compare `==`. `'36'` is not a valid character and it is not a …
  • Member Avatar for Banfa
    Banfa

    Began Watching Stream socket client

    I have some experience with client-server codes. TCP and udp client. I want to know how a stream socket works with HTTP. This client is for a server-client code where …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Stream socket client

    You don't really need to re-write the code so it works with HTTP, HTTP uses TCP/IP sockets. HTTP is from the application layer of the protocol stack and TCP from …
  • Member Avatar for Banfa
    Banfa

    Began Watching Log on to twitter with libcurl

    Hi everyone, I wanted to write C++ a program that's going to logon to my twitter and alert me if I have any new messages or tweets. I found an …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Log on to twitter with libcurl

    I assume you have actually checked out the Twitter API?
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Need help with Struct.

    Actually since this is C and the structures are also in an array you could just use qsort to sort them.
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Need help with Struct.

    > It's not exactly good practice to leave out what type malloc needs to allocate. > > Rather than this: > > score[i].FirstName = malloc(name_size + 1); > > I …
  • Member Avatar for Banfa
    Banfa

    Gave Reputation to Yimeng in Writting a simple filesystem in C using FUSE

    I've solved it.
  • Member Avatar for Banfa
    Banfa

    Began Watching Need help with Struct.

    So i'm new to C and i have a problem with struct, so when i run the program it goes to the_struct2 asks for first name and thats it. why …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Need help with Struct.

    And it also looks like you are using pointers in the members of your structures when it looks like you did not intend to. struct the_struct { char *FirstName[20]; char …
  • Member Avatar for Banfa
    Banfa

    Began Watching How to sort a vector based on int in Class

    Is there a way to sort a vector with a class that has an int variable? I want to have my vector sorted and printed in console. I want to …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in How to sort a vector based on int in Class

    If for some reason you can't or don't want to implement `operator<`, for example it is already implemented to do something else you can always use the 2nd form of …
  • Member Avatar for Banfa
    Banfa

    Began Watching my Queue is working, but not printing!

    hi so why isnt queue printing anything where it should? #include<iostream> #include<string> using namespace std; template<class ItemType> struct NodeType { ItemType info; NodeType* next; }; template<class ItemType> class Queue { …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in my Queue is working, but not printing!

    You have a few small problems but the one causing the error you are seeing is in Queue<ItemType>::Enqueue, if rear is NULL you set front but you do not set …
  • Member Avatar for Banfa
    Banfa

    Began Watching getting improper output- working with arrays of strings

    i have this code which tries to enter data into an array of string(char ptr) called token.To do this i have used a while loop to obtain a string as …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in getting improper output- working with arrays of strings

    That is because you only have 1 buffer, buff. At line 13 all you do is store a pointer to buff in the array token so all entries in token …
  • Member Avatar for Banfa
    Banfa

    Began Watching Display array reverse array

    The code isn't displaying and then reversing entered numbers. reverse.cpp // // #include <cstdlib> #include <iostream> #include "linkedStack.h" using namespace std; int main() { linkedStackType<int> stack1; linkedStackType<int> stack2; cout << …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Display array reverse array

    Your problem is between lines 23 - 31. You get 3 numbers from the user but you only use 1 variable so everytime you overwrite the previous number that the …
  • Member Avatar for Banfa
    Banfa

    Began Watching C++ program I am having problems with dealing with overloading operators

    This assignment asks to add some code from to a previous assignment I had. I have been confused about this overload operators alot and im confused on how to do …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in C++ program I am having problems with dealing with overloading operators

    You're trying to declare the same object `obj` twice at lines 19 and 22. Your use of `Fileout` as a global object is extremely bad practice and the sort of …
  • Member Avatar for Banfa
    Banfa

    Began Watching pointer initialization in assignment operator

    Hi, While executing below code i am getting error like "memory clobbered before allocated block" and due to this assignment is not happening. could you let me know what can …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in pointer initialization in assignment operator

    Problem 1: is at lines 45 and 48. You are passing pointers to objects that are on the stack but your class assumes that the objects are on the heap …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Help on Link list Delete Function

    @Nikolas9896 Firstly scanf does add '\0' to the end of strings it reads. If you have an implementation that doesn't it is non-conforming and you should get a new compiler. …
  • Member Avatar for Banfa
    Banfa

    Began Watching Help on Link list Delete Function

    Hello, could anyone here please review this code: > the deleteEntry () function are not well working. I dunno how to solve this. #include <stdlib.h> #include <stdio.h> #include <string.h> struct …
  • Member Avatar for Banfa
    Banfa

    Replied To a Post in Help on Link list Delete Function

    The problem in deleteEntry is that you just free the memory for an entry without updating any of the pointers in the list at line 24 void deleteEntry () { …
  • Member Avatar for Banfa
    Banfa

    Marked Solved Status for Strange/Undesired Compiler behaviour

    Consider this piece of code class Example { }; class ExampleAccessor { public: struct ConstructionFlag { ConstructionFlag() { } ~ConstructionFlag() { } }; explicit ExampleAccessor(Example&) { } ExampleAccessor(Example&, const ConstructionFlag&) …
  • Member Avatar for Banfa
    Banfa

    Began Watching Need a best c compiler for free download

    Hi guys ! I'm using linux OS, and i have gcc compiler in it defaultly. But i can't compile advanced programs which include "windows.h" in it. Can you please provide …

The End.