Posts
 
Reputation
Joined
Last Seen
Ranked #191
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
96% Quality Score
Upvotes Received
77
Posts with Upvotes
62
Upvoting Members
54
Downvotes Received
3
Posts with Downvotes
3
Downvoting Members
3
19 Commented Posts
~271.67K People Reached
About Me

I love to program, just a fact. I'm also very good at both programming and mathematics. I am from near Toronto in Canada. I ski.

Interests
Programming, Skiing, Kayaking, Mathematics, Chess, Computer Gaming
PC Specs
I have a very nice computer running Arch Linux on dual monitors. Ask me for more info if necessary!
Favorite Tags
c++ x 659
oop x 29
c x 22

380 Posted Topics

Member Avatar for vegaseat
Member Avatar for Reverend Jim
15
13K
Member Avatar for Tierra

I'm the same way with javascript, I find it very hard to get anything done. However most C++ constructs do exist in javacript, including multidimensional arrays, for loops, etc. You can easily google for "How to do <something> in javascript" and get loads of answers and examples. Post a first …

Member Avatar for Adnane_2
0
15K
Member Avatar for sya20

It stops working because you have no code in those sections. If you choose 'B' you will execute this code: else if (choice== 'B' || choice=='b') { } Which of course does nothing. Similarly after you create your arrays you don't do anything with them, so again it stops working. …

Member Avatar for pass4sureguide
0
417
Member Avatar for Labdabeta

Hello, I am having a bit of an issue with my networking addition to my game engine. The engine uses SDL to provide an event-driven programming environment. I tried adding networking functionality, but it doesn't seem to work. Here is the relevant code: //includes #if defined(_WIN32) #include <winsock2.h> typedef int …

0
172
Member Avatar for The Dude

I got 22... but that was with a 0 in the relationship questions, but I have never really been in any serious relationships and I am pretty sure that I would eek a few more points out of those. Also I have been diagnosed with ADHD,OCD, and Aspberger's syndrome... so …

Member Avatar for maydhyam
1
6K
Member Avatar for Labdabeta

Hello, I am working on a moderately large web development system and have been charged with developing the server-side application for the web site. As a primarily local developer I have by far the most experience in C/C++. My favourite language is Ada, just to give you a sense of …

0
289
Member Avatar for keval_hack

I don't normally resurrect dead threads, but I will make an exception. These types of esoteric programming problems are often frowned upon for teaching bad programming practices. This is not their purpose. As the IOCCC explains, these types of problems promote thinking into what might occur that would be bad …

Member Avatar for Ahamed_1
-1
2K
Member Avatar for Labdabeta

Hi. I am familiar with the following C graphics libraries: Cairo, SDL, SDL2, and OpenGL. The problem I have found with these is that they either require shared libraries (Cairo/SDL/SDL2) or are difficult to make cross-platform (OpenGL). I am wondering if there are any graphics libraries for C that do …

Member Avatar for gusano79
0
2K
Member Avatar for booglaoogla

`cin >> t1 >> t2 >> t3` I know that it seems like an unintuitive way to get 3 values from input, but it makes sense once you learn about istreams and the fact that cin is one.

Member Avatar for triumphost
0
357
Member Avatar for Ghost0s

By hand. What they did was they wrote out the code of the compiler in some slightly-higher language. Then they manually went through the code and compiled it themselves. Once that was done they could use the compiler to compile any future sources. New compilers would then be 'bootstrapped' using …

Member Avatar for Ghost0s
0
175
Member Avatar for naz1234

First of all the code `for (a=4; a<5; a=a++)` is undefined behaviour, you probably meant `for (a=4; a<5; a++)` which 'loops' a from 4 to 5 (essentially just running the loop once on the value a=4. To use a value found inside the loop outside of it, it must be …

Member Avatar for naz1234
0
231
Member Avatar for Stefce

Judging by your code it looks like you are doing Android development and trying to pass data from one activity to another. Due to the nature of Android activities (multithreaded, and can be GC'ed at any moment if, e.g. you get a phone call) you can't deal with passing data …

Member Avatar for Stefce
0
254
Member Avatar for Labdabeta

Hello, I recently wrote a program that I wish to be portable (IE: no installer, just raw files). I have made an icon for the program and can attach it to a shortcut, but not to the executable itself (it stays as the default). On top of that I have …

Member Avatar for Moot
0
233
Member Avatar for maenzaid

Functions are used to pack repeated code together. The general form of a function is this: <return-type> <identifier>(<arguments>) { <body> } This means for example that these two programs are effectively identical: A version with no functions #include <stdio.h> int main() { int mode,num; printf("Please choose to print (1) Increasing …

Member Avatar for Labdabeta
0
336
Member Avatar for chahinez.abdelo.9

In your current code you populate the array with `sc.nextInt()`, now you want to populate them with random numbers. There is a method called `Math.Random()` which gives you a random number from 0 to 1 (including 0, not including 1). You will have to 'stretch' the number you get to …

Member Avatar for chahinez.abdelo.9
0
194
Member Avatar for Amit_25

First of all that is C++, not C. Second your problem description is poor, however I think I understand what you are after. Of interest is this code snippet: //This code returns the n'th cycle of string s std::string tmp; for (int i=0; i<s.length(); ++i) tmp+=s[(i+n)%s.length()]; The way it works …

Member Avatar for Labdabeta
-2
166
Member Avatar for Labdabeta

Hello, I posted on this forum two times before about a particular pair of non-printing characters being inserted into my code. You can find the threads [here](https://www.daniweb.com/software-development/threads/441611/stray-non-printing-characters-in-my-programs) and [here](https://www.daniweb.com/software-development/cpp/threads/450296/arbitrarily-appearing-non-printing-character). Two great posters tried their best to solve this problem (mike_2000_17 and deceptikon) to no avail. Finally, using the hints that …

0
155
Member Avatar for veselin.lalov.3

Your problem is that you are printing the number of semicolons (which is the correct name for 'dotcoma', its like a colon (':') but only half ';') The line in question is printf("Row %d: %f\n", j+1, (float)dotcoma[j]); The issue here is three-fold. 1: j is uninitialized, some compilers will set …

Member Avatar for Labdabeta
0
160
Member Avatar for abelLazm

Granted, the great war for the moon breaks out. I wish I invented interstellar flight.

Member Avatar for James_40
8
9K
Member Avatar for ddanbe

I find that "Quinary son of a genetic algorithm" rolls of the tongue quite nicely when I want to let off some steam. As for a single word... Queueing's vowels sound awesome. (as noted by Randall http://xkcd.com/853/)

Member Avatar for bumsfeld
0
1K
Member Avatar for Labdabeta

Hello, I used to use Code::blocks and eclipse for code editing, but started to find them slow. I started searching for lightweight IDE's and found that the prevailing opinion is that if you are looking for lightweight code creation you should use vim/emacs, gcc and the other gnu utilities. I …

Member Avatar for Hiroshe
0
299
Member Avatar for iAssistant

Heavy rain followed by negative temperatures = black ice... black ice everywhere :O. (Waterloo, ON... I think Toronto, ON too)

Member Avatar for Stuugie
0
4K
Member Avatar for Labdabeta

Hello, I have an issue with a plain TeX document I am writing. I need to compile drawings as well as images into pdfs. I know how to get images into a pdf using \pdfximage which works if I compile with pdfTeX. I also know how to get drawings into …

0
164
Member Avatar for Labdabeta

Hello, I have a USB key on which I do all of my programming. It is formatted as an NTFS drive with 32 gigabytes of space. On this drive I have large C::B projects which contain both windows and linux executables. When I try to run the linux executables it …

Member Avatar for mike_2000_17
0
1K
Member Avatar for Doogledude123

In java, `x<<y` shifts x y bits to the left. `x>>y` [arithmetically](http://en.wikipedia.org/wiki/Arithmetic_shift) shifts x y bits to the right. `x>>>y` [logically](http://en.wikipedia.org/wiki/Logical_shift) shifts x y bits to the right. These operations are invaluable when you need to manipulate individual bits of a value. For example, lets say you are using a …

Member Avatar for Doogledude123
0
186
Member Avatar for Labdabeta

Hello, I have a bug in my program somewhere and I cannot understand why. The program merely prints data from a binary file. Here is the code: #include <iostream> #include <fstream> #include <vector> #include <cstdint> using namespace std; int main(int argc, char *argv[]) { if (argc!=2) { cout<<"Invalid argument count, …

Member Avatar for Labdabeta
0
414
Member Avatar for Labdabeta

Hello, I have learnt a few assembly languages (MIPS/x86/ARM/MIX) and I have a question about the call stack. Each of those languages uses a different method for subroutine linkage, and the way I learnt them was not conducive to recursion. Granted, if I continue reading my copy of The Art …

0
177
Member Avatar for Labdabeta

Hello, I recently took a course on assembler/compiler construction. In it we covered parsing algorithms such as LL(n), LR(n), LALR(n), and SLR(n). I understand how these parsing algorithms can be used to determine **if** an input string follows a context free grammar (CFG). At some point I also understood how …

Member Avatar for Labdabeta
0
303
Member Avatar for CreatorZeus

The issue is that `localtime` and `localtime_s` are slightly different. The _s stands for safe, it is a memory safe version of `localtime`. As such it does not create it's own `tm*` to return, rather you have to send it one. The correct code would be: time_t now = time(0); …

Member Avatar for CreatorZeus
0
5K
Member Avatar for Jake_4

This is one of those sneaky bugs. Basically it is telling you that if you declare a variable in the for loop, it only lasts as long as the for loop. At first glance it looks like you only ever use 'n' inside your loop. You are wrong. Let me …

Member Avatar for Labdabeta
0
7K
Member Avatar for Vikram Sehgal

What have you got so far? What libraries are you using for I/O (Win32API/SDL/SFML/etc)? Typically you will use your I/O library to poll for events, then detect the arrow key events and use them to modify a variable that holds the ship's position. How this is done varies by library, …

Member Avatar for Vikram Sehgal
0
254
Member Avatar for samson.dadson.3

You need to ensure that all 3 files will be included in your project. You have to set it up so that first samclass.cpp is compiled, creating samclass.o. Then main is compiled. When main compiles and sees samclass.h with undefined functions it will look for the object file and use …

Member Avatar for samson.dadson.3
0
430
Member Avatar for Labdabeta

Hello, I was recently looking through some of my code and found what I believe to be a memory leak. It is in a function that appends two strings and I am not sure how to resolve it. Here is the function: const char *strapp(const char *str,const char *s) { …

Member Avatar for mike_2000_17
0
551
Member Avatar for Afaf

There are quite a few issues with your code... I will go through them one by one. 1) Invalid entry point void main { Is not the correct way to create your main function. The correct way is: int main() { //code here } or int main(int argc, char *argv[])//or …

Member Avatar for iamthwee
0
233
Member Avatar for loldafuq

I only took a quick glance at your code. However I did notice one likely bug in your program, particularly in the CCalcCorr class. The issue is that everything in the class is private, which means it would be very difficult to actually call anything from it. You probably meant …

Member Avatar for loldafuq
0
313
Member Avatar for Labdabeta

Hello, I feel like this is probably something silly, but for some reason if I declare a variable at a certain point in my code, then never use it... it crashes. This is literally what happens: //... code here int isBuf=0;//one of my variables int zeroAddr=0;//<-- another variable I want, …

Member Avatar for Labdabeta
0
197
Member Avatar for Labdabeta

Hello, Looking at the standard streams provided by the stl libraries, it seems as though it is impossible to have 1 stream to use for both standard console IO and file/string IO. However, before I give up I would like to ask, is this possible: generic_stream stream; stream=cin; //now I …

Member Avatar for Labdabeta
1
574
Member Avatar for Labdabeta

Hello, I have a `HWND` for a window. I have double checked that it is a 100% valid window by using `SetActiveWindow()`, `SetFocus()`, and `SetForegroundWindow()` on it, successfully bringing it to the frontmost window. However whenever I try to use `GetPixel` on it it returns -1 (0xFFFFFFFF). What am I …

Member Avatar for BobS0327
0
1K
Member Avatar for mell.mattingly

You have 1 syntax problem and a few redundancy problems. First lets tackle the syntax problem so that you can get your code to run. The syntax error is that `void distance(miles)` is not valid C++ code. When you have parameters in a function it **must** have a type. What …

Member Avatar for Iworlock
0
854
Member Avatar for Labdabeta

Hello, I have a file which I need to read which contains some unusual characters (EG: 'â• ') and I need to be able to read it and convert those characters to numbers. As an example of what I am looking for would be code that reads a file and prints …

Member Avatar for Labdabeta
0
436
Member Avatar for Dani

I currently suck at web-based stuff, but I have been wanting a modified interface for awhile, I am talking with a friend of mine who is very into web-based stuff to help me out, but my main concern is that neither of us is experienced enough to get my idea …

Member Avatar for Mike_danvers
4
3K
Member Avatar for bustamorg

There are a few issues with your code, however the one causing the issue is a simple OBOE (off-by-one-error). The number one thing that jumps out at me is that you really should be using an array here, it will literally make the part of the code that deals with …

Member Avatar for rubberman
0
243
Member Avatar for Labdabeta

Hello, I wrote a library for arbitrary precision arithmetic recently and spent a long time implementing efficient multiplication algorithms. Now I am looking to see if it is possible for me to optimize anywhere else. One place that I thought should be more optimizeable is my division algorithm. Right now …

Member Avatar for mike_2000_17
0
1K
Member Avatar for Vasthor

I am not 100% sure what you are asking since I can't access the code. However I think I understand what you are asking. You have two classes that refer to each other and want to have each in their own headers. The key to remember is that the `#include …

Member Avatar for Vasthor
0
389
Member Avatar for Labdabeta

Hello, I have a particular set up of cast operators and constructors which is leading to a compile-time ambiguity error. I am wondering if somebody can explain why this is happening and what can be done to fix it. For example, here we have 2 classes: class A { int …

Member Avatar for Labdabeta
0
313
Member Avatar for blazemadej

The issue is that you set `charges=number*PRICE_CONSTANT` each time, without saving the old value. Basically here is what happens if you trace charges (program tracing is a very valuable debugging tool): Charges: ??? (since its un-initiated it could be anything, changing line 24 to `double charges=0.0;` would fix this) Choice: …

Member Avatar for blazemadej
0
842
Member Avatar for V3N0M

Check your types, noting that `char x[]` is identical to `char *x`. So you can think of `char *colors[3][10]` as being the same as `char ***colors` or `char colors[][3][10]` either way you can see that colors is one level of pointers too deep. Removing the `*` on line 5 should …

Member Avatar for V3N0M
0
121
Member Avatar for nicklock

Making games is difficult. I would put off making your current idea for a game until later and here is why. Ideas are cheap in the game industry. If you think about, say, the novel industry a good unique idea is valuable. The reason is that most good book ideas …

Member Avatar for nicklock
0
128
Member Avatar for cambalinho

I am not certain due to the ambiguity in your post, but I think you want to know how to do a deep copy. That is, how to copy pointer values of one class to another such that they don't point to the same object. For this I would point …

Member Avatar for Labdabeta
0
98
Member Avatar for Rahul47

I am not sure exactly what you mean by #2, but I can tell you about #1. The difference is that, as far as I know, you cannot create an array variable without setting it to point to a value. Specifically when you say `int a[5]={1,2,3,4,5};` it sets a to …

Member Avatar for Banfa
0
205

The End.