Member Avatar

hello guys, i found a piece of code in the net.. this code is a progress bar loop programme. I am new to programming, and i am not able to understand this code. PLEASE can anyone explain it or tell a simpler version of it. thanks(sorry for my english) #include <iostream> #define N1 1000000000 #define N2 100000000 using namespace std; int main (void) { int counter; for (counter = 0; counter < (N1+1); ++counter) { if ((counter / N2) == 2 && (counter % N2) == 0) { cout << "[==== ]20%\r"; } else if ((counter / N2) == 4 …

Member Avatar
0
14
Member Avatar

<% @ language="VBScript" %> <% Option Explicit %> <html> <body> <% Dim I,j For I = 1 to 4 For j = 1 to i Response.write i Next Response.write "<br>" Next </body> </html> Output: 1 22 333 4444 Please explain me how this output is formed. One bellow the other and is increasing

Member Avatar
0
16
Member Avatar

Hey everyone, I tried testing this code if it is true or not. But,apparently, it is indeed true. So, it is not like referencing an element in array and changing its value. Can someone explain it why this is exceptional with numbers, please? var a = 3.14; // Declare and initialize a variable var b = a; // Copy the variable's value to a new variable a = 4; // Modify the value of the original variable alert(b) // Displays 3.14; the copy has not changed Why is this happening? and it is so different from the code below: var …

Member Avatar
2
3
Member Avatar

<html> <head> </head> <body> <img src="blue hills.jpg" name="slide" width="350" height="300"/> <script type="text/javascript"> var image1=new Image() image1.src="Sunset.jpg" var image2=new Image() image2.src="Winter.jpg" var image3=new Image() image3.src="Blue hills.jpg" var image4=new Image() image4.src="turf.jpg" var image5=new Image() image5.src="white.jpg" var step=1 function slideit() { <!--if browser does not support the image object,exit.--> if(!document.images) return document.images.slide.src=eval("image"+step+".src") if(step<5) step++ else step1 setTimeout("slideit()","1500") } slideit() </script> </body> </html>

Member Avatar
0
8
Member Avatar

I know that the colon is used for inheritance. [CODE] class x { public: long y; } class Z : X { public: virtual void ret_value(y); }[/CODE] but what does this mean? [CODE]int offset:16;[/CODE] i cannot find he answer to this anywhere.

Member Avatar
0
3
Member Avatar

I've been coding in c++ for a while now, and I use string variables quite a lot. One day, I stumbled upon a char* which can also be used to "store" a string of characters, and it's been bothering me ever since that I don't really know what a string is (and by "string", I don't mean a line of characters, I mean the <cstring> string). Is it a class? A struct? A typedef? I would really like someone to give me an intermediate explanation of the inner workings of string variables. Thanks a lot

Member Avatar
0
3
Member Avatar

A C code is written: int i=-1 , j=-1 ,k=0 ,l=2 ,m; m=i++ && j++ && k++ || l++; //Line 3 printf("%d%d%d%d%d",i,j,k,l,m); O/p= 00131. I figured out that the Last variable in Line 3 is incremented only if it is preceeded by || else if preceeded by && it is not incremented. But if we take 3 variables the result is just reverse; int i=-1 , j=-1 ,k=0 ,m; m=i++ && j++ && k++; //Line 3 printf("%d%d%d%d",i,j,k,m); O/p:0010. (and abt the value of m ,its totally unpredictable. May be I'm wrong interpreting.PLz Some one tell me the exact functioning going …

Member Avatar
-5
6
Member Avatar

Ok.. so I just started python (just = 3 hours ago). I have basic input and output set. Hell I even understand slicing and stuff (OMG SUBSTRINGS SO MUCH EASIER ON PYTHON :O ) but Im finding it not so easy to understand how to use for loops (silly me. I know -.-) So I was hoping if someone could explain to me how they work in python and what's what in the syntax. Cheers. EDIT: Also, how can I just declare a variable and use it later? for example, like in java: [CODE=java] int a; //lines of codes... probably …

Member Avatar
0
6

The End.