• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:58
CEST 17:58
KST 00:58
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Balance hotfix patch 5.0.16b (July 16)51Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!5Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) [D] Wireframe Casting Removed Clem: "I don't have that much hope in Blizzard" Reynor: GSL Loss Wasn't About Preparation Format Is the larve respawn broken?
Tourneys
Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
ASL22 General Discussion NaDa’s Body Followup BW General Discussion Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) Etiquete rules in Asl?
Tourneys
[Megathread] Daily Proleagues Escore Tournament - Season 3 Small VOD Thread 2.0 [IPSL] Spring 2026 Grand Finals - This Weekend!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
Nintendo Switch Thread Path of Exile General RTS Discussion Thread Beyond All Reason Stormgate/Frost Giant Megathread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI UK Politics Mega-thread YouTube Thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread MLB/Baseball 2023 McBoner: A hockey love story Tennis[sport] Formula 1 Discussion
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8135 users

The Big Programming Thread - Page 250

Forum Index > General Forum
Post a Reply
Prev 1 248 249 250 251 252 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Ilikestarcraft
Profile Blog Joined November 2004
Korea (South)17743 Posts
Last Edited: 2013-02-18 04:57:09
February 18 2013 04:51 GMT
#4981
On February 18 2013 13:46 obesechicken13 wrote:
Does anyone else have trouble learning programming when they're near a computer? Like I keep getting distracted. What helps?

You can always try to learn this way
+ Show Spoiler +
[image loading]


I actually don't have the issue because I usually get into it when I'm learning that the only time I really do something else is because I need a break. You can try to block the sites you go on often at least when you're learning.
ils
"Nana is a goddess. Or at very least, Nana is my goddess." - KazeHydra
Shenghi
Profile Joined August 2010
167 Posts
Last Edited: 2013-02-18 21:33:26
February 18 2013 07:06 GMT
#4982
On February 18 2013 11:24 JKholodnov wrote:
Hey guys,
I'm working on a program for my c++ uni class, and am trying to figure out how to initialize n sets of arrays.
For example if the input n = k, I need to initialize "k" arrays.
What I've got right now is this:
+ Show Spoiler +

while (i<n)
{
int arrayName+i; // I want this to return arrayName1 on the first run, arrayName2 on the second, etc.
i++;
}

Where i is initialized to 1 and n is inputted earlier in the program.
Any ideas to make it work?
Much appreciated.

That thing you want with variable variable names, is not possible in C++. What you're looking for is something like this:

int **bar = new int*[n];
for (int i = 0; i < n; ++i) {
bar[i] = new int[k];
}

This allocates n arrays of k elements each.
People are not born stupid, they choose to be stupid. If you made that choice, please change your mind.
AmericanUmlaut
Profile Blog Joined November 2010
Germany2597 Posts
February 18 2013 09:18 GMT
#4983
On February 18 2013 13:46 obesechicken13 wrote:
Does anyone else have trouble learning programming when they're near a computer? Like I keep getting distracted. What helps?

1. Create a custom hosts file called "_hosts" that binds all the sites that distract you to 255.0.0.1
2. Write a batch file that swaps the files "_hosts" and "hosts", then runs ipconfig /flushdns
3. Whenever you want to work on something, run your batch file. Run it again when you're ready to stop.

That's a variation of what I do. I find that just having the extra step of switching from work mode to play mode keeps me from getting distracted too much.
The frumious Bandersnatch
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2013-02-18 15:36:37
February 18 2013 15:33 GMT
#4984
On February 18 2013 16:06 Shenghi wrote:
Show nested quote +
On February 18 2013 11:24 JKholodnov wrote:
Hey guys,
I'm working on a program for my c++ uni class, and am trying to figure out how to initialize n sets of arrays.
For example if the input n = k, I need to initialize "k" arrays.
What I've got right now is this:
+ Show Spoiler +

while (i<n)
{
int arrayName+i; // I want this to return arrayName1 on the first run, arrayName2 on the second, etc.
i++;
}

Where i is initialized to 1 and n is inputted earlier in the program.
Any ideas to make it work?
Much appreciated.

That thing you want with variable variable names, is not possible in C++. What you're looking for is something like this:

int **bar = new int*[n];
for (int i = 0; i < n; ++i)
bar[i] = new int[k];

This allocates n arrays of k elements each.

c++ has stl-containers for a reason:

int arraySize;
int numberOfArrays;
std::vector<std::vector<int>> array(numberOfArrays, std::vector<int>(arraySize));
or this if the size of the (inner) arrays is constant

const int arraySize(10);
int numberOfArrays;
std::vector<std::array<int, arraySize>> array(numberOfArrays);

edit: didn't read the previous page, I'm sorry
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
February 18 2013 17:12 GMT
#4985
On February 18 2013 18:18 AmericanUmlaut wrote:
Show nested quote +
On February 18 2013 13:46 obesechicken13 wrote:
Does anyone else have trouble learning programming when they're near a computer? Like I keep getting distracted. What helps?

1. Create a custom hosts file called "_hosts" that binds all the sites that distract you to 255.0.0.1
2. Write a batch file that swaps the files "_hosts" and "hosts", then runs ipconfig /flushdns
3. Whenever you want to work on something, run your batch file. Run it again when you're ready to stop.

That's a variation of what I do. I find that just having the extra step of switching from work mode to play mode keeps me from getting distracted too much.

I think this works well when I am at work and just need that little push. I just use notepad though and the search and replace feature. Thanks.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
InRaged
Profile Joined February 2007
1047 Posts
February 18 2013 18:23 GMT
#4986
On February 18 2013 13:46 obesechicken13 wrote:
Does anyone else have trouble learning programming when they're near a computer? Like I keep getting distracted. What helps?

I have similar problem, except I don't have trouble learning programming itself. Like openning e-book, or reading online article or even reading some source code. But the moment I need to actually *write* some code then I immediatly begin procrastinating )
It's like some kind of writers block. When I finally push myself to write, then I won't stop untill I hit some really hard design/implementation problem that requires lots of thinking. And the moment I start thinking how to solve it, procrastination hits again...

Aside from hosts file, you can also install browser add-ons. For firefox leechblock is a great anti-procrastinatioin tool. To block reddit I had to block it in both hosts and leechblock (and if there's yet another way to block it, I'd love to hear it). I also had tl.net blocked, but I've snapped and undid the block lol.
phar
Profile Joined August 2011
United States1080 Posts
February 18 2013 20:04 GMT
#4987
On February 19 2013 00:33 LukeNukeEm wrote:
Show nested quote +
On February 18 2013 16:06 Shenghi wrote:
On February 18 2013 11:24 JKholodnov wrote:
Hey guys,
I'm working on a program for my c++ uni class, and am trying to figure out how to initialize n sets of arrays.
For example if the input n = k, I need to initialize "k" arrays.
What I've got right now is this:
+ Show Spoiler +

while (i<n)
{
int arrayName+i; // I want this to return arrayName1 on the first run, arrayName2 on the second, etc.
i++;
}

Where i is initialized to 1 and n is inputted earlier in the program.
Any ideas to make it work?
Much appreciated.

That thing you want with variable variable names, is not possible in C++. What you're looking for is something like this:

int **bar = new int*[n];
for (int i = 0; i < n; ++i)
bar[i] = new int[k];

This allocates n arrays of k elements each.

c++ has stl-containers for a reason:

int arraySize;
int numberOfArrays;
std::vector<std::vector<int>> array(numberOfArrays, std::vector<int>(arraySize));
or this if the size of the (inner) arrays is constant

const int arraySize(10);
int numberOfArrays;
std::vector<std::array<int, arraySize>> array(numberOfArrays);

edit: didn't read the previous page, I'm sorry

We're guessing that the person asking the question is in a very intro class and won't be amenable to more proper solutions.
Who after all is today speaking about the destruction of the Armenians?
Phunkapotamus
Profile Joined April 2010
United States496 Posts
February 18 2013 20:43 GMT
#4988
On February 18 2013 16:06 Shenghi wrote:
Show nested quote +
On February 18 2013 11:24 JKholodnov wrote:
Hey guys,
I'm working on a program for my c++ uni class, and am trying to figure out how to initialize n sets of arrays.
For example if the input n = k, I need to initialize "k" arrays.
What I've got right now is this:
+ Show Spoiler +

while (i<n)
{
int arrayName+i; // I want this to return arrayName1 on the first run, arrayName2 on the second, etc.
i++;
}

Where i is initialized to 1 and n is inputted earlier in the program.
Any ideas to make it work?
Much appreciated.

That thing you want with variable variable names, is not possible in C++. What you're looking for is something like this:

int **bar = new int*[n];
for (int i = 0; i < n; ++i)
bar[i] = new int[k];

This allocates n arrays of k elements each.


Protip: Get in the habit of surrounding if/for loops with brackets even if you only intend to evaluate one line. This will save you many hours of headaches at some point in your career for not noticing things.
"Do a barrel roll"
Shenghi
Profile Joined August 2010
167 Posts
Last Edited: 2013-02-18 21:33:47
February 18 2013 21:32 GMT
#4989
On February 19 2013 05:43 Phunkapotamus wrote:
Show nested quote +
On February 18 2013 16:06 Shenghi wrote:
On February 18 2013 11:24 JKholodnov wrote:
Hey guys,
I'm working on a program for my c++ uni class, and am trying to figure out how to initialize n sets of arrays.
For example if the input n = k, I need to initialize "k" arrays.
What I've got right now is this:
+ Show Spoiler +

while (i<n)
{
int arrayName+i; // I want this to return arrayName1 on the first run, arrayName2 on the second, etc.
i++;
}

Where i is initialized to 1 and n is inputted earlier in the program.
Any ideas to make it work?
Much appreciated.

That thing you want with variable variable names, is not possible in C++. What you're looking for is something like this:

int **bar = new int*[n];
for (int i = 0; i < n; ++i)
bar[i] = new int[k];

This allocates n arrays of k elements each.


Protip: Get in the habit of surrounding if/for loops with brackets even if you only intend to evaluate one line. This will save you many hours of headaches at some point in your career for not noticing things.

I have set that as a general rule for myself whenever I write any code... Except when I do so before my morning coffee with only five minutes to spare. :D

Went back and edited in order to set a better example.
People are not born stupid, they choose to be stupid. If you made that choice, please change your mind.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-02-18 23:32:01
February 18 2013 23:28 GMT
#4990
I just want to express my appreciation of how much easier Java is than C. I also think I'm going to ask for help in the near future, haha. At least now I know why my C lecturer asks us to implement only math stuff. His major was math before switching to Computer Science. -.-

Edit: Ok, here's a simple problem.

Input two positive integers a and b (separated by one space). a and b can be very large (up to 99 digits). Output a+b. You are not allowed to use floating-point data types, including float, double, and long double.


Could you give a hint what to use or what to look for? Except for GMP (which may not be accepted by the Online Judge) and floating-point data types.
Abductedonut
Profile Blog Joined December 2010
United States324 Posts
Last Edited: 2013-02-18 23:36:44
February 18 2013 23:36 GMT
#4991
On February 19 2013 08:28 darkness wrote:
I just want to express my appreciation of how much easier Java is than C. I also think I'm going to ask for help in the near future, haha. At least now I know why my C lecturer asks us to implement only math stuff. His major was math before switching to Computer Science. -.-

Edit: Ok, here's a simple problem.

Show nested quote +
Input two positive integers a and b (separated by one space). a and b can be very large (up to 99 digits). Output a+b. You are not allowed to use floating-point data types, including float, double, and long double.


Could you give a hint what to use or what to look for? Except for GMP (which may not be accepted by the Online Judge) and floating-point data types.


Keep in mind that your computer can only store 64-bit or 32-bit numbers. Your best bit is to store the numbers in an array and write the addition operation yourself. It's quite easy. Actually, I find this really interesting, so if you like I could write it for you.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-02-18 23:39:01
February 18 2013 23:37 GMT
#4992
On February 19 2013 08:36 Abductedonut wrote:
Show nested quote +
On February 19 2013 08:28 darkness wrote:
I just want to express my appreciation of how much easier Java is than C. I also think I'm going to ask for help in the near future, haha. At least now I know why my C lecturer asks us to implement only math stuff. His major was math before switching to Computer Science. -.-

Edit: Ok, here's a simple problem.

Input two positive integers a and b (separated by one space). a and b can be very large (up to 99 digits). Output a+b. You are not allowed to use floating-point data types, including float, double, and long double.


Could you give a hint what to use or what to look for? Except for GMP (which may not be accepted by the Online Judge) and floating-point data types.


Keep in mind that your computer can only store 64-bit or 32-bit numbers. Your best bit is to store the numbers in an array and write the addition operation yourself. It's quite easy. Actually, I find this really interesting, so if you like I could write it for you.


Yeah, go ahead if you don't mind. I find C very challenging, sometimes even really hard because Java provides so much more support in my opinion. I try to learn it anyway.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
February 18 2013 23:53 GMT
#4993
On February 19 2013 08:37 darkness wrote:
Show nested quote +
On February 19 2013 08:36 Abductedonut wrote:
On February 19 2013 08:28 darkness wrote:
I just want to express my appreciation of how much easier Java is than C. I also think I'm going to ask for help in the near future, haha. At least now I know why my C lecturer asks us to implement only math stuff. His major was math before switching to Computer Science. -.-

Edit: Ok, here's a simple problem.

Input two positive integers a and b (separated by one space). a and b can be very large (up to 99 digits). Output a+b. You are not allowed to use floating-point data types, including float, double, and long double.


Could you give a hint what to use or what to look for? Except for GMP (which may not be accepted by the Online Judge) and floating-point data types.


Keep in mind that your computer can only store 64-bit or 32-bit numbers. Your best bit is to store the numbers in an array and write the addition operation yourself. It's quite easy. Actually, I find this really interesting, so if you like I could write it for you.


Yeah, go ahead if you don't mind. I find C very challenging, sometimes even really hard because Java provides so much more support in my opinion. I try to learn it anyway.

If you're studying computer science, I'd vouch for C though. I hear too often about guys that graduate with Java degrees around here and can't pass an interview at the local studios and companies here in Redmond WA.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2013-02-18 23:59:36
February 18 2013 23:58 GMT
#4994
Solve the it in java then, using list or array, and then do it again in C. The problem should be the same, the syntax of the language isn't going to be that complicated for a problem of that scope.

And then just be glad that you're not being asked to do this problem using transistors or logic gates, because that's what you have to do in an EE course :p


What will really prevent you from getting a job in the future is not whether you learn java or C, it's if you don't actually learn how to crank out code solutions to problems yourself. The specific language is pretty irrelevant.
Who after all is today speaking about the destruction of the Armenians?
Abductedonut
Profile Blog Joined December 2010
United States324 Posts
February 19 2013 00:23 GMT
#4995
On February 19 2013 08:37 darkness wrote:
Show nested quote +
On February 19 2013 08:36 Abductedonut wrote:
On February 19 2013 08:28 darkness wrote:
I just want to express my appreciation of how much easier Java is than C. I also think I'm going to ask for help in the near future, haha. At least now I know why my C lecturer asks us to implement only math stuff. His major was math before switching to Computer Science. -.-

Edit: Ok, here's a simple problem.

Input two positive integers a and b (separated by one space). a and b can be very large (up to 99 digits). Output a+b. You are not allowed to use floating-point data types, including float, double, and long double.


Could you give a hint what to use or what to look for? Except for GMP (which may not be accepted by the Online Judge) and floating-point data types.


Keep in mind that your computer can only store 64-bit or 32-bit numbers. Your best bit is to store the numbers in an array and write the addition operation yourself. It's quite easy. Actually, I find this really interesting, so if you like I could write it for you.


Yeah, go ahead if you don't mind. I find C very challenging, sometimes even really hard because Java provides so much more support in my opinion. I try to learn it anyway.


This is by no means a pretty solution (I didn't include comments in the for loop that does the actual adding on purpose, variables are named stupidly, etc etc). Also, by no means is the code robust or error free. I didn't really test all the cases. I just wrote the program and verified that it kinda worked. It's up to you from here. Here you go.

Also, this code might go a little above your head. Sorry if it does!

+ Show Spoiler +

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
char a[100], b[100], temp[100], sum[101];
memset(sum,0,101);
scanf("%s",a);
scanf("%s",b);

//Swap the strings
if ( strlen(b) > strlen(a) )
{
strcpy(temp,b);
strcpy(b,a);
strcpy(a,temp);
}

// We could reuse temp but that's bad practice
char temp2[100];
strcpy(temp2,b);
//Fill b with zeros until strings are aligned
if( strlen(a) != strlen(b) )
{
int difference = strlen(a) - strlen(b);
memset(b,'0',difference);
strcpy(b+difference,temp2);
}

printf("A is: %s \n",a);
printf("B is: %s \n \n",b);
char carry = '0';
short int a_int = 0, b_int = 0, carry_int = 0;
char temp3[3];
temp3[0] = '\0';
temp3[1] = '\0';
temp3[2] = '\0';


for ( int i = 0; i < strlen(b); i++ )
{
a_int = a[strlen(a)-i-1] - '0'; //A small hack to convert a character to an int
b_int = b[strlen(b)-i-1] - '0';
carry_int = carry - '0';

sprintf(temp3,"%s%d",temp3,(a_int+b_int+carry_int));
sum[ strlen(a)-i-1 ] = (temp3[1] == NULL) ? temp3[0] : temp3[1];
carry = (temp3[1] != NULL) ? temp3[0] : '0';

temp3[0] = '\0';
temp3[1] = '\0';
}

printf("Sum is: %s \n",sum);
system("PAUSE");
return 0;
}
phar
Profile Joined August 2011
United States1080 Posts
February 19 2013 00:34 GMT
#4996
functions are your friend
Who after all is today speaking about the destruction of the Armenians?
Abductedonut
Profile Blog Joined December 2010
United States324 Posts
February 19 2013 00:39 GMT
#4997
On February 19 2013 09:34 phar wrote:
functions are your friend


To be fair, I wrote that code while "reading" The Bell Jar for one of my GE classes (I don't like reading books like that).

It's procrastination code. Didn't put much though into it. Just wanted to get him an idea of how to solve it.
Caution
Profile Joined September 2004
2059 Posts
February 19 2013 00:43 GMT
#4998
On February 17 2013 10:59 darkness wrote:
Okay, this is JavaScript code for long division which I found here - http://weblog.bocoup.com/long-division-in-javascript/

+ Show Spoiler +


function longDivision(n,d){
var num = n + "",
numLength = num.length,
remainder = 0,
answer = '',
i = 0;

while( i < numLength + 3){
var digit = i < numLength ? parseInt(num[i] : 0;

if (i == numLength){
answer = answer + ".";
}

answer = answer + Math.floor((digit + (remainder * 10))/d);
remainder = (digit + (remainder * 10))%d;
i++;
}
return parseFloat(answer);
}

longDivision(356,8);


I've tried to make it work in Java, and this is what I have so far:

+ Show Spoiler +


public class test {
public static double longDivision(int d, int n) {
String[] num = new String[1000];
num[0] = "" + n;
int numLength = num.length;
int remainder = 0;
String answer = "";
int i = 0;

while (i < numLength + 3) {
int digit = i < numLength ? Integer.parseInt(num[i] : 0;

if (i == numLength){
answer = answer + ".";
}

answer = answer + Math.floor((digit + (remainder * 10))/d);
remainder = (digit + (remainder * 10))%d;
i++;
}

return Double.parseDouble(answer);
}

public static void main (String[] args) {
System.out.printf("%f\n", longDivision(356,8));
}
}


I have 2 problems though:
1. 'var' in JavaScript is so ambigious, I'm left to guess what data type to use in Java.
2. I'm still not sure what to do with the num array which probably causes the whole program not to work as it should.

Edit: Nevermind, ternary isn't touched here, but the num array looks rather messy.

And yeah, I get this error:

+ Show Spoiler +


Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at test.longDivision(test.java:11)
at test.main(test.java:26)


NumberFormatException: null at the line of declaring 'digit'.


Hi,

I'm not sure if you've figured this out, but here are a couple of things I noticed and hopefully this should give you a bit of a nudge into the right direction.


+ Show Spoiler +

JS

//this returns the length of the input. e.g "100" will return 3
var num = n + "",
numLength = num.length,


JAVA

//this is returning the length of the array i.e. it will always return 1000
String[] num = new String[1000];
num[0] = "" + n;
int numLength = num.length;


Change your numLength declaration to:


int numLength = String.valueOf(n).length();

also change

int digit = i < numLength ? Integer.parseInt(num[i]) : 0;
to

int digit = i < numLength ? numLength : 0;



This should get rid of your errors


Also I think you may also have your function parameters swapped around?

JinRho
Profile Joined June 2010
United States38 Posts
February 19 2013 00:52 GMT
#4999
From someone with very little to no programming experience, can someone mentor me?
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
February 19 2013 00:58 GMT
#5000
On February 19 2013 09:52 JinRho wrote:
From someone with very little to no programming experience, can someone mentor me?

http://www.randygaul.net/category/beginner/

This could be the beginning of something huge!
Prev 1 248 249 250 251 252 1032 Next
Please log in or register to reply.
Live Events Refresh
PSISTORM Gaming Misc
15:55
FSL TeamLeaguePlayoffs STvsASH
Liquipedia
Epic.LAN
13:00
Epic.LAN 48 Playoff Stage
epiclan99
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko735
BRAT_OK 127
CosmosSc2 57
Livibee 43
RushiSC 40
StarCraft: Brood War
Calm 5150
Rain 2106
Hyuk 1528
Britney 1327
Shuttle 973
Horang2 589
Stork 375
Mini 358
BeSt 308
ggaemo 166
[ Show more ]
Mong 83
Sharp 58
Free 50
Aegong 42
JulyZerg 40
soO 39
Barracks 33
Killer 33
Movie 28
ToSsGirL 24
Rock 24
Shine 23
yabsab 17
Terrorterran 15
Hm[arnc] 13
HiyA 13
IntoTheRainbow 11
Purpose 8
Noble 6
Dota 2
Gorgc9034
League of Legends
Doublelift3504
KnowMe33
Counter-Strike
fl0m679
allub530
kRYSTAL_90
Heroes of the Storm
Khaldor232
Trikslyr57
MindelVK9
Other Games
singsing1933
B2W.Neo754
Liquid`RaSZi647
DeMusliM293
ceh9243
Hui .181
ToD153
XaKoH 111
Organizations
Other Games
gamesdonequick2247
BasetradeTV186
StarCraft 2
TaKeTV104
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Pr0nogo 5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2512
• TFBlade613
Other Games
• Shiphtur115
Upcoming Events
IPSL
2m
Dragon vs Hawk
WardiTV Invitational
2m
RSL Revival
17h 2m
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
18h 2m
OSC
21h 2m
IPSL
1d
Bonyth vs Ret
WardiTV Weekly
1d 19h
Monday Night Weeklies
2 days
OSC
2 days
PiGosaur Cup
3 days
[ Show More ]
The PondCast
3 days
Replay Cast
4 days
CrankTV Team League
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Korean StarCraft League
6 days
RSL Revival
6 days
Online Event
6 days
Liquipedia Results

Completed

Escore Tournament S3: W3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
YSL S3
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.