Posts
 
Reputation
Joined
Last Seen
Ranked #472
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
87% Quality Score
Upvotes Received
24
Posts with Upvotes
22
Upvoting Members
15
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
6 Commented Posts
~95.3K People Reached
About Me

Well im a self taught programmer who stumbled upon programming at Uni in second semester on my 2nd year(07/08). Since then iv bought 13 programming books and completed well ,... 1 of them. But iv worked through a good amount of the rest just have to…

Interests
Umm ,... well as simple as it may seem my main interests are Alcohol (social drinking i think its called…
PC Specs
Core i5 quad 2.8ghz 4gb ram, 120gb ssd, HD6770 GPU

129 Posted Topics

Member Avatar for Suzie999

Hi, it was about 3 years ago now, but i used a combination of getifaddrs and SO_BINDTODEVICE to force udp traffic through a specific NIC ignoring the routing table. i was working with embedded linux 2.6.32 but i believe there is similar functionality on windows, bsd and mac as well …

Member Avatar for Kanoisa
0
420
Member Avatar for Kanoisa

Recently i have come up with the scenario where i need a single class to handle a few different interfaces and i have found a few different approaches to take. I was wondering if anyone has encountered the same situation and can give me any suggestion(s) as to if there …

Member Avatar for Kanoisa
0
288
Member Avatar for CodeWarrior14

Hi, I would make the following suggestions to help you out. Garbage data - `char buffer[MAX_BUFFER_LEN];` gives you uninitialised memory - it could contain anything. so using strlen on it is not reliable, fread will not null terminate the string for you and you risk running off the end of …

Member Avatar for Dervish1
0
3K
Member Avatar for Wajed

Hi Wajed To answer your questions: "WSADATA is info, but what info is it specifically?" For Windows API methods your first port of call will often be MSDN. Heres the MSDN on WSAStartup which explains the WSADATA struct. [MSDN: WSAStartup function](https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213%28v=vs.85%29.aspx) "What is the differenece between initiating WS2_32.dll and SOCKET?" …

Member Avatar for Kanoisa
0
165
Member Avatar for bops

Hey i was also suffering that problem when i came upon your thread, and i found however , when out of nowhere my brain said why did this work yesterday and not today, the answer is i had started a windows project today instead of a console application and that …

Member Avatar for muhammad raees
0
29K
Member Avatar for mixelplik

Hi, I have a solution for you, the issue is that you are trying to detect the first row and do something on that. i find that its easier to detect the end of the row and insert a new line there. I have fully commented my code so check …

Member Avatar for L7Sqr
0
424
Member Avatar for skyyadav

Hi, so i tried a small test on my machine, i compiled the following code #include <string> #include <iostream> int main( void ) { std::string s("56"); std::cout << "As string: " << s << " As int " << std::stoi(s) << std::endl; return 0; } Im using Ubuntu 12.04lts so …

Member Avatar for Kanoisa
0
1K
Member Avatar for waqas.zafar.125

Hi, I would suggest making a function for this task, its job would be to do the n*n read from the file. The function would prototype something like `int read_matrix_ints_from_file( ifstream& fstream, int** outputMatrix, size_t rows, size_t cols ); ` Notes: - size_t is just an unsigned integer type that …

Member Avatar for Kanoisa
0
165
Member Avatar for sirlink99

Hi, as you are working with files and external devices i would suggest you use flush on your writing stream http://www.cplusplus.com/reference/ostream/ostream/flush/ .This should force data to be written from any memory buffers to the file. However i could not say for sure because of the nature of usb / flash …

Member Avatar for sirlink99
0
392
Member Avatar for Kanoisa

Hi all, I have a problem with trying to call a protected base class function from an inherited class. I have done some research and from what i can gather what i am trying to do is simply not permitted by the standard. The error i get when trying to …

Member Avatar for mike_2000_17
0
206
Member Avatar for coutnoob

The task you have seems quite unusual. with regards to > 2 constructors (the one has as variables the number and each length (how is that possible), There a few options for this as the constructor will need a different number of arguments for each polygon type. One option is …

Member Avatar for Kanoisa
1
4K
Member Avatar for haven_u

Pop a headder struct at the top of the file which is of sixed size. It would contain file size data. i would suggest a struct something like. struct MatrixFileHeadderInfoVer1_st { int m_nVersion; //file headder version int m_nMatrixColumns; int m_nMatricRows; }; With something like you can later update the file …

Member Avatar for adityatandon
0
134
Member Avatar for Labdabeta

Hi if your free to use any IDE then have you tried Eclipse CDT, its very much like code blocks, built in GCC with GDB debugger, can also be used to compile Java, GWT web applications and more. I used CodeBlocks a while ago i dont recall having any issues …

Member Avatar for Goemon
0
9K
Member Avatar for markrodriguez0

Firstly please use code tags, it makes your code easier to read. For your problem you really have the first part done, try making a second function that will parse words from your sentance using the space delimiter. And for each word decide what to do with it. as each …

Member Avatar for iamthwee
0
1K
Member Avatar for Kanoisa

Hi all, I have started finding lots of uses for abstract classes to define interfaces for common functionality using polymorphism and i know that using polymorphism and virtual functions incurrs some additional call cost of functions. So what im wondering is can i get the best of both worlds? consider …

Member Avatar for Kanoisa
0
196
Member Avatar for franmaez_0716

[icode]#include <irrKlang.h>[/icode] should be [icode]#include "irrKlang.h"[/icode] ?? if the file lives in your project not in CC it should almost definatley be in quotes instead of angle brackets.

Member Avatar for franmaez_0716
0
2K
Member Avatar for ruval002

[quote=ruval002] the problem is that my sort function takes forever[/quote] Have you checked the logic of your sort function to make sure it does not result in an infinate loop? For a sort function to take "forever" you would need a very large amount of data or there is a …

Member Avatar for Ancient Dragon
0
132
Member Avatar for KRUX17

If im reading your code correctly, you are adding to the file first a string then an int. So when you read back from the file you are writing a string into an int and im not 100% sure how iostreams handle that. Try just outputting the int to the …

Member Avatar for KRUX17
0
168
Member Avatar for SCass2010

Really im not entirely sure why you want to do this, but one method available for this is polymorphism. But it is meant to provide a common functionality and hide the details of how / by whom the work is handled.

Member Avatar for SCass2010
0
115
Member Avatar for Ahmed2

You have a global variable named t, and a variable t in your for loop, inside the [icode]FileOutput()[/icode] function the loop counter variable t is referred to as a (its name inside the function as you specified) so when you do [icode]cout<<t<<totallength<<endl;[/icode] you are using the global value t which …

Member Avatar for Ahmed2
0
239
Member Avatar for yongj

When you get to threadding and that area consider looking at boost, its a c++ library that provides os independant threadding and control structures( support for, windows, and *nix, i think more but i havent looked extensively ) .It is supported on may architectures from desktop (x86/64) to arm-cortexA8 and …

Member Avatar for Kanoisa
0
121
Member Avatar for ruval002

An idea that may be viable for you is to define operator overload for > operator for your element type and use STL sorting routines? STL offers most of the popular sorting routines. see [URL="http://www.developer.nokia.com/Community/Wiki/CS001099_-_Sorting_class_and_struct_types_using_STL_sort"]http://www.developer.nokia.com/Community/Wiki/CS001099_-_Sorting_class_and_struct_types_using_STL_sort[/URL] for help

Member Avatar for Kanoisa
0
276
Member Avatar for danymota19

So, you have tried what exactly? Whats the question? we arn't going to write your code for you

Member Avatar for Kanoisa
0
114
Member Avatar for C++ programmer

In addition, as AD pointed out win32 is a very daunting topic, But let me give you a flip side, Why should you not learn win32? I would say the biggest argument against win32 is (excluding *nix and mac crazies) that your restricting yourself to one operating system albeit practially …

Member Avatar for Ancient Dragon
0
142
Member Avatar for karmstrong

Ok this isnt exactly what you want but i think you may be stepping to far to fast. What i find helps this kind of problem is to draw on paper 4 boxes in a row, make them your pretend elements. Then draw your class as a box at the …

Member Avatar for karmstrong
0
314
Member Avatar for KazenoZ

Hi, i just thought id try with visual studio for you and it works just fine. my code is as follows [code] #include <cstdlib> #include <iostream> using std::cout; using std::endl; using std::cin; int main(int argc, char** argv) { if(argc<2) { cout<<"Usage: "<<argv[0]<<" string"<<endl; return -1; } char* location = new …

Member Avatar for Shimano
0
1K
Member Avatar for Kanoisa

Hi all, This is quite a specific question with a relatively large amount of explaining so ill try to make it really short to try save peoples time. In a nutshell what i have is a large csv file and im trying to search a particular entry (line in the …

Member Avatar for Kanoisa
0
1K
Member Avatar for FEC

Ok So the above posts are giving the right idea's kindof i think :P For what i would consider a easier explination try the following. An abstract class can not be created as an object, its purpose is to create an API or interface to a collection of objects who …

Member Avatar for Kanoisa
-1
381
Member Avatar for crapgarden

Hi, if Rashakil's explination is beyond you, you can use a typecast to treat your enum as say an integer. whilst it looks a bit uglier and can down the line cause subtle problems. But if you dont want to or dont understand how to write an overloaded operator you …

Member Avatar for ashishseo
0
209
Member Avatar for arsalanghouri

I think to help you we would need to see your project to see how you are stroing the data and things, it would really help. At the moment we know you have something that makes a soduko game~(or at least i think thats what you have from what you …

Member Avatar for arsalanghouri
0
126
Member Avatar for Kanoisa

Hi all, I am currently working with some c++ code on an ARM processor. The issue i am having is that when my application hits a segfault i am unable to get any information as to what caused it. My dev machine is ubuntu 10.04 LTS and i am using …

Member Avatar for Kanoisa
0
386
Member Avatar for murnesty

Its possible the issue lies in struct.h an incomplete type or syntax error there could easily have such a knock on effect. Can you post struct.h code too please? Alternatively if you cannot do that, then swap the order of your includes to include test.h first and see if the …

Member Avatar for Kanoisa
0
1K
Member Avatar for geekme

As regards to which IDE you need? that very much depends on as mentioned above what you hope to achieve, and what OS you use, If you want full 3D graphics then you are most likely looking at openGL DirectX or SDL and if you are talking about user IF …

Member Avatar for Kanoisa
0
212
Member Avatar for pritpal.singh88

Hi, I think the issue you are facing is that the input stream needs cleared after a call to cin before getline. As far as i recall cin leaves the '\n' character on the stream so getline returns with nothing. See this post from narue on how to achieve this …

Member Avatar for Kanoisa
0
127
Member Avatar for jamesl22

This question should be in games dev, but heres what i think ok. Make a crouch animation function maybe something like this [code] void animateCrouch(double dt, bool crouchDir, entityType entity, entityIndexType entID ..other vars) { if( true == crouchDir )//moving down is true { /* calculate how far the entiy …

Member Avatar for jamesl22
0
281
Member Avatar for fadi_1234

I dont understand what your trying to do, Into an iostream library? there is no input or output which is what iostream is for. Can you explain a bit further what you are trying to achieve please?

Member Avatar for rubberman
0
106
Member Avatar for caltech

Cant blame gcc My GCC version [quote] compiled on ubuntu 10.04 LTS GCC Target: i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) [/quote] Compile options [quote] g++ main.cpp -O0 -g -o testapp [/quote] output [quote] ./testapp 0 0 1 0 2 0 3 0 4 0 5 0 6 …

Member Avatar for VernonDozier
-7
247
Member Avatar for scarlettmoon

I dont get the issue you mentioned, but i found if you have a space in the name, then the program goes nuts, to solve this you can try changing the delimiting character to '\n' or something else. If you can can you use std::string instead of char[] as its …

Member Avatar for scarlettmoon
0
134
Member Avatar for Silvershaft

Lets not forget wxWidgets as well. Like QT its cross platform, it allows the user to plug in OpenGL or use GDI(on windows), not sure what the GDI equiv on linux is. Qt may also support this i dont know but from what litle i have done with wxWidgets it …

Member Avatar for Stefano Mtangoo
0
468
Member Avatar for Narril

I assume you are using some IDE, in it there will be a field for additional includes directories, add the directory that contans your header to that field., if you are compiling from the command line its -i<dir> for gcc (off the top of my head) Hope this helps

Member Avatar for Kanoisa
0
175
Member Avatar for SSully

Hi, I think check if its 0 and then changing it to a non 0 value is the way to go, but look again at your code [code] if (d == 0) //if d ==0 then make it non 0 { denominator = 1; } numerator = n; denominator = …

Member Avatar for Kanoisa
0
259
Member Avatar for Kanoisa

Hi all, I'm currently thinking about how to make a thread safe queue. Specified as such: [LIST] [*]Single reader [*]Multiple writers [*]Dynamically sized [*]Suitable for both a reader sleeping on a queue or as a polled queue [/LIST] So what I'm looking at so far (pseudo)code wise is the following …

Member Avatar for Kanoisa
0
659
Member Avatar for LevyDee

Hi, im not sure what compiler your using but it is possible that it uses 16 bit ints by default? This means that with your 30kb file the size would be under the 65k limit of 16 bit int, and then the 400k files overflows the int? Just thought it …

Member Avatar for Kanoisa
0
148
Member Avatar for tdba.316

The one thing i would advise first off, is that in headers files the tradition is to ONLY declare function prototypes, classes/structures and types. The actual objects themselves should be delcared in a cpp file. So the code to create the variables of these types and operate them should not …

Member Avatar for tdba.316
0
2K
Member Avatar for zacblazic

Hi, Have you considered combining your code for the row and column minimum and maximum checks into one function?

Member Avatar for anilashanbhag
0
121
Member Avatar for FriXionX

To get a character use [icode]cin>>var;[/icode] to verify that character you can use an if such as [icode] if( var=='a' || var=='A')[/icode] which would check for upper or lower case character a. You can also look into the character formatting functions such as [icode] toupper() [/icode] which converts a character …

Member Avatar for Kanoisa
0
246
Member Avatar for RapidFire4Life

Hi, candidate and votes are both protected members of your class so you cannot access them in main. you should write access and set functions to your class. so say you add a function to your class [code] AddCandidate(std::string name) { candidates.push_back(name); //adds candiate to the list } [/code] this …

Member Avatar for RapidFire4Life
0
269
Member Avatar for Arbus

I cant say i know anything about turbo c++ and playing music with it but i would be willing to bet in your project options there is somehwere to add additional includes directories, use that to add the path to where the libary you want to use keeps its .h …

Member Avatar for Kanoisa
0
417
Member Avatar for andimiami

Well there is a relatively simple method for this. You can take your filtered text input as character string and make those into c++ strings, then append them into a string stream (like how you can to cout), then read them back like you can from cin. assuming you have …

Member Avatar for mrnutty
0
209
Member Avatar for Kanoisa

Hi all, I have begun workin on getting c++ to do physics and things for me so im working on some maths functions. starting small and working up, Just did this one on prime number generation and was wondering if anyone can point out any ways it could be ,made …

Member Avatar for Kanoisa
0
288

The End.