473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

i need to increment my variable in fastly.

i need help for fast increment.

i assigned int i=0; when my condition get true (1), i want to get fast increment(example...i= 1, 53 , 63 ,100 this type of increment)in i value .so how i ll write a code in c.

sorry for my English .
thanks for advance help
Aug 27 '15 #1
5 1312
weaknessforcats
9,208 Expert Mod 8TB
I need more information. What do you mean by "fast" increment?
Can you give me a better example?
Aug 27 '15 #2
thank u sir,

now i am working as a embedded developer ..in my project contain 3 buttons(up & down & menu) .int i=0 , when press up button once int i should increment to 1...after release then same button pressed i=2 this is common code..

int a,i=0;
if(input(up)==0)
{
a=++i;
printf("%d",a);
}

so now pressed up button continuously then my i value get multiple increment....example, 1,3,4,6,64,87,93,356,467..this is not needed but this type of increment needed.
with regards,
karthik
thank you for advance help
Aug 28 '15 #3
weaknessforcats
9,208 Expert Mod 8TB
What is the algorithm for this sequence: 1,3,4,6,64,87,93,356,467 ?

There are two parts involved in the "up" button being pressed: key-up and key-down. Are you able to sense these two states?

If so, repeated key-down events would cause your sequence to be calculated.

The key-up would reset the sequence.

Tell me more.
Aug 28 '15 #4
maximum value = 1000.
int i;

if(condition_1==true)
{
//variable i should get increment by 1.
}

else if(condition_2==true)
{
//variable i should reach the maximum value 1000 faster . How to write logic for this???
}

thanks
Aug 29 '15 #5
weaknessforcats
9,208 Expert Mod 8TB
//variable i should reach the maximum value 1000 faster . How to write logic for this???

Yes, I understand that. But what I want to know is how you calculated these numbers: 1,3,4,6,64,87,93,356,467 ?
Aug 29 '15 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable...
2
by: Hans-Michael Rupp | last post by:
Hello! I need to a assign a node(-set) conditionally to a varialbe like: <xsl:variable name="foo"> <xsl:if test="$bar=''"> <!-- how can I access a node here ?--> </xsl:if> <xsl:if...
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
1
by: Brett Hofer | last post by:
Does anyone know of a good component for audio(.WAV) playback that supports double-speed/normal/half-speed? I need to provide this control in an .aspx page and control it using C#. I have tried...
2
by: Ramez T. Mina | last post by:
I tried to increment variable when I click on a button, but it didn't work. I use the VB.NET editor and not the HTML editor. any one can help??
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
5
by: Jim via DotNetMonster.com | last post by:
Hi, I need to pass the value of a variable from one function to another but I don't seem to get the value. I declare the variable outside all functions. What I'm trying to do is that when the...
3
by: ali | last post by:
Hi, When I pass a pointer as an argument of a method, is it safe if I change the data pointed by the argument and return it upon completion ? For example: Object* someFunction(Object* ob)...
1
by: mrityunjay11 | last post by:
the code is as #!/bin/sh i=1; while do echo "welcome $i times"; i= 'expr $i + 1 '; done
35
by: erik gartz | last post by:
Hi. I'd like to be able to write a loop such as: for i in range(10): pass but without the i variable. The reason for this is I'm using pylint and it complains about the unused variable i. I can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.