Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 27 results for
araay
- Page 1
C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
…[i] into arraay4[8] ? int onefunction(int
araay
[]){ ....... ....... arraay1[i]; arraay2[i]; } int twofunction(int
araay
[]){ arraay3[8] = {0}; arraay4[8] = {0…
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
Like this? int onefunction(int
araay
[]){ arraay1[i]; arraay2[i]; } int twofunction(int araay1[], int araay2[]){ arraay3[8] = {0}; arraay4[8] = {0}; int i; for(i = 0; i < sizeof(araay1); i++) array3[i] = araay1[i]; }
Re: Dynamic Array
Programming
Software Development
14 Years Ago
by ItecKid
…] push (@ARRAY, $VALUE); [/code] puts VALUE onto the end of
ARAAY
, and increases the size of ARRAY by one. Unshift will…
Re: Dynamic Array
Programming
Software Development
14 Years Ago
by santhanalakshmi
…] push (@ARRAY, $VALUE); [/code] puts VALUE onto the end of
ARAAY
, and increases the size of ARRAY by one. Unshift will…
Re: PHP array to JS array
Programming
Web Development
12 Years Ago
by phoenix_2000
… = mysql_query($sql); $loop = 1; for($row = mysql_fetch_array($exec)) { echo ("
araay
[" . $loop . "] = " . $row['fieldtobeechoed'] . ";"); $loop++; } ?>…
Re: PHP array to JS array
Programming
Web Development
12 Years Ago
by vitaquous
… = mysql_query($sql); $loop = 1; for($row = mysql_fetch_array($exec)) { echo ("
araay
[" . $loop . "] = " . $row['fieldtobeechoed'] . ";"); $loop++; } ?>…
Problem with Function in Araay
Programming
Web Development
14 Years Ago
by hemgoyal_1990
Hi all, I Have a Problem in my Function. I am created a Recursion Function in PHP and also Created a Array. But I Have a Trouble That How to Store This Recursion Function Value in Array. Please Help Me I Want to Store Recursion Function Value in PHP and Print it Our of Loop. Please Help. Thanx.
Re: Problem with Function in Araay
Programming
Web Development
14 Years Ago
by Will Gresham
To add an item to an array, do this: [code] $array_name[] = 'Value'; [/code] Then to print out the entire array: [code] foreach($array_name as $key => $value) { echo $value . "<br />"; } [/code] If that is not what you want then post an example of your code.
Re: Problem with Function in Araay
Programming
Web Development
14 Years Ago
by Atli
Hey. To add to an array from withing a recursive function, you need to either import a global variable into the function, or pass it as a reference parameter. [code=php] $myArray = array(); function setValue($value) { if($value < 100) { global $myArray; $myArray[] = $value; setValue($value+1); } } [/code] [code=php]…
multidimetional araay to json
Programming
Web Development
9 Years Ago
by Priti_P
Hi There, I had a multidimentional array with values. I wanted to convert it into JSON I tried it with : `json=JSON.stringify(skill_array);` But it gave me output as below: [["Language","C++","0","1","May 2014","ascasc"],["DataBase","C++","0","1&…
Re: multidimetional araay to json
Programming
Web Development
9 Years Ago
by Priti_P
Hello, I was so silly that I did not convert it with JSON_decode() Its solved now
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by WaltP
Use a loop.
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
How?
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by WaltP
You've never used a loop before?
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
Of Course, but i'm learning functions now, since yesterday. I can't figure out how to use the loop here.
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by Ancient Dragon
if you want to copy the arrays that are declared in oneFunction() into the arrays declared in twoFunction() then onefunction() will have to call twofunction() passing it the two arrays. twofunction() will need two parameters, not one.
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by WaltP
The exact same way you do *there*. define funct(A1, size-of-array) { define a2 loop from 0 to size-of-array copy values }
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by deceptikon
> The exact same way you do there. Wait. You're saying that the syntax and semantics of loops *don't* change from function definition to function definition? That's just crazy talk. ;p
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by WaltP
Kind of. `sizeof` doesn't quite work that way. You want to pass the size into the function. What does `onefunction()` do?
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
onefunction() calculate the values of 2 numbers, a number with 8 digits and a number with 5 digits, and store the values into 2 arrays. > You want to pass the size into the function. What do you mean? How can i do that?
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by WaltP
> What do you mean? How can i do that? Think. Reread your section on functions. Just because you post a question here does not mean you can turn your brain off. You still have to figure many things out for yourself.
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
If i knew that, I would not ask the question. I can't figure out how to do it.
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
Thanks all for your "solutions".
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by deceptikon
> I can't figure out how to do it. You know how to get the size of an array, and you know how to pass arguments into a function. Put those two together and it's easy to see why one might think you've turned your brain off: #include <stdio.h> void foo(int size) { printf("%d\n", size); } int …
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by equation
It is not a homework. I try to understand how arrays and functions work together. I start programming 3 weeks ago. What do you expect you all programming experts if a new programmer try to learn how to program? Try to remember your first steps. This is not an answer: "Use loops". What is that mean? I tried with loops, i tried with …
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by deceptikon
> Try to remember your first steps. Sorry dude, but you'll get no sympathy from me on that front. The resources you have at your disposal would have given me a woody when I was first learning. > This is not an answer: "Use loops". Did you learn anything at all from the code I provided? You pass the size of the array from the …
Re: C - How to copy values of 2 arrays...
Programming
Software Development
11 Years Ago
by nitin1
firstly, I will advice you to read what are loops and what is sizeof! then read more about C and its syntax and more about pointers. then read about functions and then about arguments. keep doing like this, and then try to implement various things in C. that will be beneficial to you and all. ;)
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC