Search Results

Search found 19376 results on 776 pages for 'char array'.

Page 1/776 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C++ difference between "char *" and "char * = new char[]"

    - by nashmaniac
    So, if I want to declare an array of characters I can go this way char a[2]; char * a ; char * a = new char[2]; Ignoring the first declaration, the other two use pointers. As far as I know the third declaration is stored in heap and is freed using the delete operator . does the second declaration also hold the array in heap ? Does it mean that if something is stored in heap and not freed can be used anywhere in a file like a variable with file linkage ? I tried both third and second declaration in one function and then using the variable in another but it didn't work, why ? Are there any other differences between the second and third declarations ?

    Read the article

  • C# assign char and char array to string?

    - by Bopha
    char character = 'c'; string str = null; str = character.ToString();//this is ok char[] arrayChar = { 'a', 'b', 'c', 'd' }; string str2 = null; str2 = string.Copy(arrayChar.ToString());//this is not ok str2 = arrayChar.ToString();//this is not ok. I'm trying to converting char array to string, but the last two attempts don't work. Other source I found and they have to create new string type, but I don't know why. Can someone give me little explaination, thanks.

    Read the article

  • PHP Associative array sort

    - by Mithun
    I have an array like one below. Currently it is sorted alphabetically by the OwnerNickName field. Now i want to brig the array entry with OwnerNickName 'My House' as the first entry of the array and rest sorted alphabetically by OwnerNickName. Any idea? Array ( [0318B69D-5DEB-11DF-9D7E-0026B9481364] => Array ( [OwnerNickName] => andy [Rooms] => Array ( [0] => Array ( [Label] => Living Room [RoomKey] => FC795A73-695E-11DF-9D7E-0026B9481364 ) ) ) [286C29DE-A9BE-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => anton [Rooms] => Array ( [0] => Array ( [Label] => KidsRoom [RoomKey] => E79D7991-64DC-11DF-9D7E-0026B9481364 ) [1] => Array ( [Label] => Basement [RoomKey] => CC12C0C4-68AA-11DF-9D7E-0026B9481364 ) [2] => Array ( [Label] => Family Room [RoomKey] => 67A280D4-64D9-11DF-9D7E-0026B9481364 ) ) ) [8BE18F84-AC22-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => mike [Rooms] => Array ( [0] => Array ( [Label] => Family Room [RoomKey] => 1C6AFB39-6835-11DF-9D7E-0026B9481364 ) ) ) [29B455DE-A9BC-102D-9C16-00163EEDFCFC] => Array ( [OwnerNickName] => My House [Rooms] => Array ( [0] => Array ( [Label] => Basement [RoomKey] => 61ECFAB2-6376-11DF-9D7E-0026B9481364 ) [1] => Array ( [Label] => Rec Room [RoomKey] => 52B8B781-6376-11DF-9D7E-0026B9481364 ) [2] => Array ( [Label] => Deck [RoomKey] => FFEB4102-64DE-11DF-9D7E-0026B9481364 ) [3] => Array ( [Label] => My Room2 [RoomKey] => 112473E4-64DF-11DF-9D7E-0026B9481364 ) [4] => Array ( [Label] => Bar Room [RoomKey] => F82C47A8-64DE-11DF-9D7E-0026B9481364 ) ) ) )

    Read the article

  • Searching for a key in a multi dimensional array and adding it to another array [migrated]

    - by Moha
    Let's say I have two multi dimensional arrays: array1 ( stuff1 = array ( data = 'abc' ) stuff2 = array ( something = '123' data = 'def' ) stuff3 = array ( stuff4 = array ( data = 'ghi' ) ) ) array2 ( stuff1 = array ( ) stuff3 = array ( anything = '456' ) ) What I want is to search the key 'data' in array1 and then insert the key and value to array2 regardless of the depth. So wherever key 'data' exists in array1 it gets added to array2 with the exact depth (and key names) as in array1 AND without modifying any other keys. How can I do this recursively?

    Read the article

  • C appending char to char*

    - by Ostap Hnatyuk
    So I'm trying to append a char to a char*. For example I have char *word = " "; I also have char ch = 'x'; I do append(word, ch); Using this method.. void append(char* s, char c) { int len = strlen(s); s[len] = c; s[len+1] = '\0'; } It gives me a segmentation fault, and I understand why I suppose. Because s[len] is out of bounds. How do I make it so it works? I need to clear the char* a lot as well, if I were to use something like char word[500]; How would I clear that once it has some characters appended to it? Would the strlen of it always be 500? Thanks in advance.

    Read the article

  • Checking if an array contains all elements of another array

    - by mozcelikors
    I'm designing an electrical engineering application. However, i'm stuck on this: I have the following array <?php // Static Array $GroupOfEight = array ( array(0,1,3,2,4,5,7,6), array(4,5,6,7,16,12,13,14), array(12,13,15,14,8,9,11,10), array(2,6,14,10,3,7,15,11), array(1,3,5,7,13,15,9,11), array(0,4,12,8,1,5,13,9), array(0,1,3,2,8,9,11,10) ); ?> And I have another array, but this one is one dimensional. <?php $myStack = array(0,1,3,2,4,5,7,6); //Dynamic, gets value by POST method. ?> What I want to do is to check if $myStack is equal to any sub array of $GroupOfEight array. ( Number ordering is not important. The script should just check if every elements contained. It's not important if their order is same or not. ) Here is what I've done to solve the issue so far: <?php //Check if stackArray contains 8group for($i=0; $i<count($GroupOfEight);$i++) for($j=0; $j<count($GroupOfEight[$i]); $j++){ //$containsSearch = count(array_intersect($search_this,$all)) == count($search_this); $containsSearch = count(array_intersect($stackArray,$GroupOfEight[$j])) == count($stackArray); echo $containsSearch; } ?> Please help me correct my code or introduce me the solution of this issue, Thanks.

    Read the article

  • initializing char and char pointers

    - by ra170
    What's the difference between these: This one works: char* pEmpty = new char; *pEmpty = 'x'; However if I try doing: char* pEmpty = NULL; pEmpty = 'x'; // <---- doesn't work! and: char* pEmpty = "x"; // putting in double quotes works! why??

    Read the article

  • Const unsigned char* to char*

    - by BSchlinker
    So, I have two types at the moment: const unsigned char* unencrypted_data_char; string unencrypted_data; I'm attempting to perform a simple conversion of data from one to the other (string - const unsigned char*) As a result, I have the following: strcpy((unencrypted_data_char),(unencrypted_data.c_str())); However, I'm receiving the error: error C2664: 'strcpy' : cannot convert parameter 1 from 'const unsigned char *' to 'char *' Any advise? I thought using reinterpret_cast would help, but it doesn't seem to make a difference.

    Read the article

  • how to use char* as char[]

    - by phunehehe
    Hello, I have a struck like this typedef struct bookStruct { char title[80]; char author[80]; } BookType; And I have two strings like this char *title = "A Book on C"; char *author = "A. Kelly"; Now I can't create a BookType like this BookType book = {title, author}; Can anyone tell me what is wrong? How can I do that?

    Read the article

  • Converting a flat array to a nested array

    - by matte
    Hi, I am trying to convert a flat array to a nested array depending on the 'level' data of each array item. 'level' data shows us if current array item is a child, a parent or a sibling. Here is the flat array: $sequentialArray = array( array('title'=>'Page 1', 'level'=>0), array('title'=>'Page 2', 'level'=>0), array('title'=>'Page 3', 'level'=>1), array('title'=>'Page 4', 'level'=>1), array('title'=>'Page 5', 'level'=>2), array('title'=>'Page 6', 'level'=>0), array('title'=>'Page 7', 'level'=>1), array('title'=>'Page 8', 'level'=>0) ); And here is the expected result: $nestedArray = array( array('title'=>'Page 1', 'children'=>array()), array('title'=>'Page 2', 'children'=>array( array('title'=>'Page 3', 'children'=>array()), array('title'=>'Page 4', 'children'=>array( array('title'=>'Page 5', 'children'=>array()) )), )), array('title'=>'Page 6', 'children'=>array( array('title'=>'Page 7', 'children'=>array()) )), array('title'=>'Page 8', 'children'=>array()), ); I tried using references with array indexes but that didn't work. Any ideas?

    Read the article

  • char[] and char* compatibility?

    - by Aerovistae
    In essence, will this code work? And before you say "Run it and see!", I just realized my cygwin didn't come with gcc and it's currently 40 minutes away from completing reinstallation. That being said: char* words[1000]; for(int i = 0; i<1000; i++) words[i] = NULL; char buffer[ 1024 ]; //omit code that places "ADD splash\0" into the buffer if(strncmp (buffer, "ADD ", 4){ char* temp = buffer + 4; printf("Adding: %s", temp); int i = 0; while(words[i] != NULL) i++; words[i] = temp; } I'm mostly uncertain about the line char* temp = buffer + 4, and also whether I can assign words[i] in the manner that I am. Am I going to get type errors when I eventually try to compile this in 40 minutes? Also-- if this works, why don't I need to use malloc() on each element of words[]? Why can I say words[i] = temp, instead of needing to allocate memory for words[i] the length of temp?

    Read the article

  • php if array key exists inside multidimentional array

    - by Richard
    how can i check if logo exists in this array called $attachements print_r is below: Array ( [logo] = /home/richar2/public_html/ioagh/images/stories/jreviews/20100510115659_1_img.gif ) when theres no logo, the array print_r's Array ( ) i tried: if (isset($attachments['logo']) ) {..} but the conditional code runs when there is no logo

    Read the article

  • C++ Static array vs. Dynamic array?

    - by user69514
    What is the difference between a static array and a dynamic array in C++? I have to do an assignment for my class and it says not to use static arrays, only dynamic arrays. I've looked in the book and online, but I don't seem to understand. I thought static was created at compile time and dynamic at runtime, but I might be mistaken this with memory allocation. Can you explain to me the difference between static array and dynamic array in C++? Thnaks.

    Read the article

  • Difference between static const char* and const char*.

    - by Will MacDonagh
    Could someone please explain the difference in how the 2 snippets of code are handled below? They definitely compile to different assembly code, but I'm trying to understand how the code might act differently. I understand that string literals are thrown into read only memory and are effectively static, but how does that differ from the explicit static below? struct Obj1 { void Foo() { const char* str( "hello" ); } }; and struct Obj2 { void Bar() { static const char* str( "hello" ); } };

    Read the article

  • build error with boost spirit grammar (boost 1.43 and g++ 4.4.1)

    - by lurscher
    I'm having issues getting a small spirit/qi grammar to compile. The build stack trace is fugly enought to not make any sense to me (despite some assertion_failed i could notice in there but that didn't brought much information) the input grammar header: inputGrammar.h #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix_core.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spirit/include/phoenix_fusion.hpp> #include <boost/spirit/include/phoenix_stl.hpp> #include <boost/fusion/include/adapt_struct.hpp> #include <boost/variant/recursive_variant.hpp> #include <boost/foreach.hpp> #include <iostream> #include <fstream> #include <string> #include <vector> namespace sp = boost::spirit; namespace qi = boost::spirit::qi; using namespace boost::spirit::ascii; //using namespace boost::spirit::arg_names; namespace fusion = boost::fusion; namespace phoenix = boost::phoenix; using phoenix::at_c; using phoenix::push_back; template< typename Iterator , typename ExpressionAST > struct InputGrammar : qi::grammar<Iterator, ExpressionAST(), space_type> { InputGrammar() : InputGrammar::base_type( block ) { tag = sp::lexeme[+(alpha) [sp::_val += sp::_1]];//[+(char_ - '<') [_val += _1]]; block = sp::lit("block") [ at_c<0>(sp::_val) = sp::_1] >> "(" >> *instruction[ push_back( at_c<1>(sp::_val) , sp::_1 ) ] >> ")"; command = tag [ at_c<0>(sp::_val) = sp::_1] >> "(" >> *instruction [ push_back( at_c<1>(sp::_val) , sp::_1 )] >> ")"; instruction = ( command | tag ) [sp::_val = sp::_1]; } qi::rule< Iterator , std::string() , space_type > tag; qi::rule< Iterator , ExpressionAST() , space_type > block; qi::rule< Iterator , ExpressionAST() , space_type > function_def; qi::rule< Iterator , ExpressionAST() , space_type > command; qi::rule< Iterator , ExpressionAST() , space_type > instruction; }; the test build program: i seems the build fails at qi::phrase_parse, i am using boost 1.43 and g++ 4.4.1 #include <iostream> #include <string> #include <vector> using namespace std; //my grammar #include <InputGrammar.h> struct MockExpressionNode { std::string name; std::vector< MockExpressionNode > operands; typedef std::vector< MockExpressionNode >::iterator iterator; typedef std::vector< MockExpressionNode >::const_iterator const_iterator; iterator begin() { return operands.begin(); } const_iterator begin() const { return operands.begin(); } iterator end() { return operands.end(); } const_iterator end() const { return operands.end(); } bool is_leaf() const { return ( operands.begin() == operands.end() ); } }; BOOST_FUSION_ADAPT_STRUCT( MockExpressionNode, (std::string, name) (std::vector<MockExpressionNode>, operands) ) int const tabsize = 4; void tab(int indent) { for (int i = 0; i < indent; ++i) std::cout << ' '; } template< typename ExpressionNode > struct ExpressionNodePrinter { ExpressionNodePrinter(int indent = 0) : indent(indent) { } void operator()(ExpressionNode const& node) const { cout << " tag: " << node.name << endl; for (int i=0 ; i < node.operands.size() ; i++ ) { tab( indent ); cout << " arg "<<i<<": "; ExpressionNodePrinter(indent + 2)( node.operands[i]); cout << endl; } } int indent; }; int test() { MockExpressionNode root; InputGrammar< string::const_iterator , MockExpressionNode > g(); std::string litA = "litA"; std::string litB = "litB"; std::string litC = "litC"; std::string litD = "litD"; std::string litE = "litE"; std::string litF = "litF"; std::string source = litA+"( "+litB+" ,"+litC+" , "+ litD+" ( "+litE+", "+litF+" ) "+ " )"; string::const_iterator iter = source.begin(); string::const_iterator end = source.end(); bool r = qi::phrase_parse( iter , end , g , root , space ); ExpressionNodePrinter< MockExpressionNode > np; np( root ); }; int main() { test(); } finally, the build error is the following: /usr/bin/make -f nbproject/Makefile-linux_amd64_devel.mk SUBPROJECTS= .build-conf make[1]: se ingresa al directorio `/home/mineq/NetBeansProjects/InputParserTests' /usr/bin/make -f nbproject/Makefile-linux_amd64_devel.mk dist/linux_amd64_devel/GNU-Linux-x86/vpuinputparsertests make[2]: se ingresa al directorio `/home/mineq/NetBeansProjects/InputParserTests' mkdir -p build/linux_amd64_devel/GNU-Linux-x86 rm -f build/linux_amd64_devel/GNU-Linux-x86/tests_main.o.d g++ `llvm-config --cxxflags` `pkg-config --cflags unittest-cpp` `pkg-config --cflags boost-1.43` `pkg-config --cflags boost-coroutines` -c -g -I../InputParser -MMD -MP -MF build/linux_amd64_devel/GNU-Linux-x86/tests_main.o.d -o build/linux_amd64_devel/GNU-Linux-x86/tests_main.o tests_main.cpp from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/auto.hpp:16, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi.hpp:15, from /home/mineq/third_party/boost_1_43_0/boost/spirit/include/qi.hpp:16, from ../InputParser/InputGrammar.h:12, from tests_main.cpp:14: /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp: In function ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]’: In file included from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/detail/parse_auto.hpp:14, /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:125: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::spirit::ascii::space_type]’ tests_main.cpp:206: instantiated from here /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:99: error: no matching function for call to ‘assertion_failed(mpl_::failed************ (boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]::error_invalid_expression::************)(InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode> (*)()))’ /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:125: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::spirit::ascii::space_type]’ tests_main.cpp:206: instantiated from here /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:100: error: no matching function for call to ‘assertion_failed(mpl_::failed************ (boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]::error_invalid_expression::************)(MockExpressionNode))’ from /home/mineq/third_party/boost_1_43_0/boost/proto/proto.hpp:12, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/support/meta_compiler.hpp:17, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/meta_compiler.hpp:14, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/action/action.hpp:14, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/action.hpp:14, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi.hpp:14, from /home/mineq/third_party/boost_1_43_0/boost/spirit/include/qi.hpp:16, from ../InputParser/InputGrammar.h:12, from tests_main.cpp:14: /home/mineq/third_party/boost_1_43_0/boost/proto/detail/expr0.hpp: At global scope: /home/mineq/third_party/boost_1_43_0/boost/proto/proto_fwd.hpp: In instantiation of ‘boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>()>, 0l>’: In file included from /home/mineq/third_party/boost_1_43_0/boost/proto/core.hpp:13, /home/mineq/third_party/boost_1_43_0/boost/utility/enable_if.hpp:59: instantiated from ‘boost::disable_if<boost::proto::result_of::is_expr<boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>()>, 0l>, void>, void>’ /home/mineq/third_party/boost_1_43_0/boost/spirit/home/support/meta_compiler.hpp:200: instantiated from ‘boost::spirit::result_of::compile<boost::spirit::qi::domain, InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), boost::fusion::unused_type, void>’ /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:107: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]’ /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:125: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::spirit::ascii::space_type]’ tests_main.cpp:206: instantiated from here /home/mineq/third_party/boost_1_43_0/boost/proto/detail/expr0.hpp:64: error: field ‘boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>()>, 0l>::child0’ invalidly declared function type from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/auto.hpp:16, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi.hpp:15, from /home/mineq/third_party/boost_1_43_0/boost/spirit/include/qi.hpp:16, from ../InputParser/InputGrammar.h:12, from tests_main.cpp:14: /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp: In function ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]’: In file included from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/detail/parse_auto.hpp:14, /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:125: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::spirit::ascii::space_type]’ tests_main.cpp:206: instantiated from here /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:107: error: request for member ‘parse’ in ‘boost::spirit::compile [with Domain = boost::spirit::qi::domain, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>()](((InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode> (&)())((InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode> (*)())expr)))’, which is of non-class type ‘InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>()’ from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/auto.hpp:15, from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi.hpp:15, from /home/mineq/third_party/boost_1_43_0/boost/spirit/include/qi.hpp:16, from ../InputParser/InputGrammar.h:12, from tests_main.cpp:14: /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/skip_over.hpp: In function ‘void boost::spirit::qi::skip_over(Iterator&, const Iterator&, const T&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, T = boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]::skipper_type]’: In file included from /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/auto/auto.hpp:19, /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:112: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, boost::spirit::qi::skip_flag::enum_type, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::proto::exprns_::expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::spirit::tag::char_code<boost::spirit::tag::space, boost::spirit::char_encoding::ascii> >, 0l>]’ /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/parse.hpp:125: instantiated from ‘bool boost::spirit::qi::phrase_parse(Iterator&, Iterator, const Expr&, const Skipper&, Attr&) [with Iterator = __gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Expr = InputGrammar<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, MockExpressionNode>(), Skipper = MockExpressionNode, Attr = const boost::spirit::ascii::space_type]’ tests_main.cpp:206: instantiated from here /home/mineq/third_party/boost_1_43_0/boost/spirit/home/qi/skip_over.hpp:27: error: ‘const struct MockExpressionNode’ has no member named ‘parse’ make[2]: *** [build/linux_amd64_devel/GNU-Linux-x86/tests_main.o] Error 1 make[2]: se sale del directorio `/home/mineq/NetBeansProjects/InputParserTests' make[1]: *** [.build-conf] Error 2 make[1]: se sale del directorio `/home/mineq/NetBeansProjects/InputParserTests' make: *** [.build-impl] Error 2 BUILD FAILED (exit value 2, total time: 1m 48s)

    Read the article

  • how to get rid off garbage in array of chars?

    - by fang_dejavu
    hi, I'm writing a C program but I keep having problems with my array of chars. I keep getting garbage when I print it using prinf. here is an example of what I get when I print it: char at t.symbol is Aôÿ¿ char at tabl[0].symbol is A char at tabl[1].symbol is a char at tabl[2].symbol is a char at tabl[3].symbol is d char at tabl[4].symbol is e char at tabl[5].symbol is f char at tabl[6].symbol is g char at tabl[7].symbol is h char at tabl[8].symbol is i char at tabl[9].symbol is x char at t[0].symbol is a0AÃ char at t[1].symbol is b)@Ã4 char at t[2].symbol is ckU* char at t[3].symbol is Aôÿ¿ char at t[4].symbol is gØ could someone tell me how to get rid off the garbage in the array of chars? here is my code #define MAX 100 #ifndef SYMBSIZE #define SYMBSIZE 1 #endif typedef struct tableme { char symbol[SYMBSIZE]; int value; int casenmbr; int otherinfo; }tabletype; int main(int argc, char **argv) { tabletype t[MAX]; t[3].symbol[0] = 'A'; t[0].value=1; t[0].casenmbr = 7; t[0].otherinfo = 682; tabletype tabl[MAX]; tabl[0].value = 1; tabl[0].symbol[0] = 'A'; tabl[1].value = 11; tabl[1].symbol[0]= 'a'; tabl[2].value = 12; tabl[2].symbol[0] = 'a'; tabl[3].value = 13; tabl[3].symbol[0] = 'd'; tabl[4].value = 14; tabl[4].symbol[0] = 'e'; tabl[5].value = 15; tabl[5].symbol[0] = 'f'; tabl[6].value = 16; tabl[6].symbol[0] = 'g'; tabl[7].value = 17; tabl[7].symbol[0] = 'h'; tabl[8].symbol[0] = 'i'; tabl[9].symbol[0] = 'x'; t[1].symbol[0] = 'b'; t[0].symbol[0]= 'a'; t[2].symbol[0]= 'c'; t[4].symbol[0]= 'g'; printf("char at t.symbol is %s \n", t[3].symbol); for( x=0;x<10;x++) { printf("char at tabl[%d].symbol is %s \n",x, tabl[x].symbol); } int j; for(j = 0; j<5;j++) { printf("char at t[%d].symbol is %s \n",j, t[j].symbol); } return 0; }

    Read the article

  • Sorting a Multidimensional array...

    - by sologhost
    I need to sort an array that can look like this: $array[4][0] = array('id' => 1, 'value' => 2); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][1] = array('id' => 1, 'value' => 0); $array[1][3] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][0] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); But needs to be sorted and returned as this: $array[1][0] = array('id' => 2, 'value' => 1); $array[1][1] = array('id' => 3, 'value' => 0); $array[1][2] = array('id' => 3, 'value' => 2); $array[1][3] = array('id' => 2, 'value' => 1); $array[2][1] = array('id' => 0, 'value' => 2); $array[2][4] = array('id' => 3, 'value' => 1); $array[3][0] = array('id' => 2, 'value' => 1); $array[3][1] = array('id' => 1, 'value' => 0); $array[3][2] = array('id' => 0, 'value' => 3); $array[4][0] = array('id' => 1, 'value' => 2); $array[4][1] = array('id' => 1, 'value' => 0); Can anyone help me? It needs to sort both indexes of the array from lowest to highest index value. Sounds simple enough, but I'm having the hardest time trying to figure this out, while still keeping the values intact. Please help someone...

    Read the article

  • Read array dump output and generates the correspondent XML file

    - by Christian
    Hi, The text below is the dump of a multidimensional array, dumped by the var_dump() PHP function. I need a Java function that reads a file with a content like this (attached) and returns it in XML. For a reference, in site http://pear.php.net/package/Var_Dump/ you can find the code (in PHP) that generates dumps in XML, so all neeeded logic is there (I think). I will be waiting for your feedback. Regards, Christian array(1) { ["Processo"]= array(60) { ["Sistema"]= string(6) "E-PROC" ["UF"]= string(2) "RS" ["DataConsulta"]= string(19) "11/05/2010 17:59:17" ["Processo"]= string(20) "50000135320104047100" ["NumRegistJudici"]= string(20) "50000135320104047100" ["IdProcesso"]= string(30) "711262958983115560390000000001" ["SeqProcesso"]= string(1) "1" ["Autuado"]= string(19) "08/01/2010 12:04:47" ["StatusProcesso"]= string(1) "M" ["ComSituacaoProcesso"]= string(2) "00" ["Situacao"]= string(9) "MOVIMENTO" ["IdClasseJudicial"]= string(10) "0000000112" ["DesClasse"]= string(18) "INQUÉRITO POLICIAL" ["CodClasse"]= string(6) "000120" ["SigClasse"]= string(3) "INQ" ["DesTipoInquerito"]= string(0) "" ["CodCompetencia"]= string(2) "21" ["IdLocalidadeJudicial"]= string(4) "7150" ["ClasseSigAutor"]= string(5) "AUTOR" ["ClasseDesAutor"]= string(5) "AUTOR" ["ClasseSigReu"]= string(7) "INDICDO" ["ClasseDesReu"]= string(9) "INDICIADO" ["ClasseCodReu"]= string(2) "64" ["TipoAcao"]= string(8) "Criminal" ["TipoProcessoJudicial"]= string(1) "2" ["CodAssuntoPrincipal"]= string(6) "051801" ["CodLocalidadeJudicial"]= string(2) "00" ["IdAssuntoPrincipal"]= string(4) "1504" ["IdLocalizadorOrgaoPrincipal"]= string(30) "711264420823128430420000000001" ["ChaveConsulta"]= string(12) "513009403710" ["NumAdministrativo"]= NULL ["Magistrado"]= string(28) "RICARDO HUMBERTO SILVA BORNE" ["IdOrgaoJuizo"]= string(9) "710000085" ["IdOrgaoJuizoOriginario"]= string(9) "710000085" ["DesOrgaoJuizo"]= string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoJuizo"]= string(10) "RSPOACR02F" ["CodOrgaoJuizo"]= string(9) "RS0000085" ["IdOrgaoSecretaria"]= string(9) "710000084" ["DesOrgaoSecretaria"]= string(31) "02a VF CRIMINAL DE PORTO ALEGRE" ["SigOrgaoSecretaria"]= string(9) "RSPOACR02" ["CodOrgaoSecretaria"]= string(9) "RS0000084" ["IdSigilo"]= string(1) "0" ["IdUsuario"]= string(30) "711262951173995330420000000001" ["DesSigilo"]= string(10) "Sem Sigilo" ["Localizador"]= string(25) "EM TRÂMITE ENTRE PF E MPF" ["TotalCda"]= int(0) ["DesIpl"]= string(8) "012/2010" ["Assunto"]= array(1) { [0]= array(4) { ["IdAssuntoJudicial"]= string(4) "1504" ["SeqAssunto"]= string(1) "1" ["CodAssunto"]= string(6) "051801" ["DesAssunto"]= string(84) "Moeda Falsa / Assimilados (arts. 289 e parágrafos e 290), Crimes contra a Fé Pública" } } ["ParteAutor"]= array(1) { [0]= array(12) { ["IdPessoa"]= string(30) "771230778800100040000000000508" ["TipoPessoa"]= string(3) "ENT" ["Nome"]= string(15) "POLÍCIA FEDERAL" ["Identificacao"]= string(14) "79621439000191" ["SinPartePrincipal"]= string(1) "S" ["IdProcessoParte"]= string(30) "711262958983115560390000000002" ["IdProcessoParteAtributo"]= NULL ["IdRepresentacao"]= NULL ["TipoRepresentacao"]= NULL ["AtributosProcessoParte"]= NULL ["Relacao"]= NULL ["Procurador"]= array(6) { [0]= array(4) { ["Nome"]= string(25) "SOLON RAMOS CARDOSO FILHO" ["Sigla"]= string(13) "cor-sr-dpf-rs" ["IdUsuarioProcurador"]= string(30) "711262893271855450420000000001" ["TipoUsuario"]= string(3) "CPF" } [1]= array(4) { ["Nome"]= string(18) "LUCIANA IOP CECHIN" ["Sigla"]= string(11) "luciana.lic" ["IdUsuarioProcurador"]= string(30) "711262946806708880420000000001" ["TipoUsuario"]= string(3) "CPF" } [2]= array(4) { ["Nome"]= string(31) "ALEXANDRE DA SILVEIRA ISBARROLA" ["Sigla"]= string(15) "drcor-sr-dpf-rs" ["IdUsuarioProcurador"]= string(30) "711262949451860560420000000001" ["TipoUsuario"]= string(3) "CPF" } [3]= array(4) { ["Nome"]= string(24) "JUCÉLIA TERESINHA PISONI" ["Sigla"]= string(11) "jucelia.jtp" ["IdUsuarioProcurador"]= string(30) "711262950492275450420000000001" ["TipoUsuario"]= string(3) "CPF" } [4]= array(4) { ["Nome"]= string(32) "MARCOS ANTONIO SIQUEIRA PICININI" ["Sigla"]= string(13) "picinini.masp" ["IdUsuarioProcurador"]= string(30) "711262951173995330420000000001" ["TipoUsuario"]= string(3) "APF" } [5]= array(4) { ["Nome"]= string(20) "PRISCILLA BURLACENKO" ["Sigla"]= string(12) "priscilla.pb" ["IdUsuarioProcurador"]= string(30) "711262955631630740420000000001" ["TipoUsuario"]= string(3) "DPF" } } } } ["ParteReu"]= array(1) { [0]= array(11) { ["IdPessoa"]= string(30) "711262958983115560390000000001" ["TipoPessoa"]= string(2) "PF" ["Nome"]= string(8) "A APURAR" ["Identificacao"]= NULL ["SinPartePrincipal"]= string(1) "S" ["IdProcessoParte"]= string(30) "711262958983115560390000000001" ["IdProcessoParteAtributo"]= NULL ["IdRepresentacao"]= NULL ["TipoRepresentacao"]= NULL ["AtributosProcessoParte"]= NULL ["Relacao"]= NULL } } ["OutraParte"]= array(1) { [0]= array(10) { ["Nome"]= string(26) "MINISTÉRIO PÚBLICO FEDERAL" ["CodTipoParte"]= string(3) "114" ["DesTipoParte"]= string(3) "MPF" ["SinPolo"]= string(1) "N" ["Identificacao"]= string(13) "3636198000192" ["SinPartePrincipal"]= string(1) "N" ["IdProcessoParte"]= string(30) "711262958983115560390000000003" ["IdPessoa"]= string(30) "771230778800100040000000000217" ["TipoPessoa"]= string(3) "ENT" ["Procurador"]= array(1) { [0]= array(4) { ["Nome"]= string(25) "MARIA VALESCA DE MESQUITA" ["IdUsuarioProcurador"]= string(30) "711265220162198740420000000001" ["TipoUsuario"]= string(1) "P" ["Sigla"]= string(5) "pr528" } } } } ["DadoComplementar"]= array(6) { [0]= array(5) { ["DesDadoComplem"]= string(21) "Antecipação de Tutela" ["ValorDadoComplem"]= string(13) "Não Requerida" ["IdDadoComplementar"]= string(1) "1" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000003" ["IdDadoComplementarValor"]= string(1) "4" } [1]= array(5) { ["DesDadoComplem"]= string(16) "Justiça Gratuita" ["ValorDadoComplem"]= string(13) "Não Requerida" ["IdDadoComplementar"]= string(1) "4" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000001" ["IdDadoComplementarValor"]= string(1) "3" } [2]= array(5) { ["DesDadoComplem"]= string(15) "Petição Urgente" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "5" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000004" ["IdDadoComplementarValor"]= string(1) "2" } [3]= array(5) { ["DesDadoComplem"]= string(22) "Prioridade Atendimento" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "2" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000006" ["IdDadoComplementarValor"]= string(1) "2" } [4]= array(5) { ["DesDadoComplem"]= string(9) "Réu Preso" ["ValorDadoComplem"]= string(3) "Não" ["IdDadoComplementar"]= string(1) "6" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000002" ["IdDadoComplementarValor"]= string(1) "2" } [5]= array(5) { ["DesDadoComplem"]= string(24) "Vista Ministério Público" ["ValorDadoComplem"]= string(3) "Sim" ["IdDadoComplementar"]= string(1) "3" ["NumIdProcessoDadoComplem"]= string(30) "711262958983115560390000000005" ["IdDadoComplementarValor"]= string(1) "1" } } ["SemPrazoAbrir"]= bool(true) ["Evento"]= array(8) { [0]= array(18) { ["IdProcessoEvento"]= string(30) "711269271039215440420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "166" ["SeqEvento"]= string(1) "8" ["DataHora"]= string(19) "22/03/2010 12:19:16" ["SinExibeDesEvento"]= string(1) "S" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= string(7) "90 DIAS" ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(7) "ap18785" ["idUsuario"]= string(30) "711263330517182580420000000001" ["DesPeticao"]= string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]= string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [1]= array(18) { ["IdProcessoEvento"]= string(30) "711269032501923580420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "166" ["SeqEvento"]= string(1) "7" ["DataHora"]= string(19) "19/03/2010 18:04:59" ["SinExibeDesEvento"]= string(1) "S" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= string(7) "90 DIAS" ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(37) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(5) "pr700" ["idUsuario"]= string(30) "711262976146980920420000000002" ["DesPeticao"]= string(25) "DILAÇÃO DE PRAZO DEFERIDA" ["DescricaoCompleta"]= string(75) "PETIÇÃO PROTOCOLADA JUNTADA - 90 DIAS - DILAÇÃO DE PRAZO DEFERIDA - 90 DIAS" } [2]= array(19) { ["IdProcessoEvento"]= string(30) "711268077089625240420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "165" ["SeqEvento"]= string(1) "6" ["DataHora"]= string(19) "08/03/2010 16:55:48" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(2) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711268077089625240420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "CERT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711268077089625240420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "DESP" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [3]= array(19) { ["IdProcessoEvento"]= string(30) "711267732906972600420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "5" ["DataHora"]= string(19) "04/03/2010 17:20:29" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(5) "pr700" ["idUsuario"]= string(30) "711262976146980920420000000002" ["Documento"]= array(1) { [0]= array(6) { ["IdUsuario"]= string(30) "711262976146980920420000000002" ["IdDocumento"]= string(30) "711267732906972600420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(3) "PET" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [4]= array(19) { ["IdProcessoEvento"]= string(30) "711265889365256290420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(3) "165" ["SeqEvento"]= string(1) "4" ["DataHora"]= string(19) "11/02/2010 09:59:04" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(2) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711265222866995860420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "PORT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711265222866995860420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" ["DescricaoCompleta"]= string(26) "PEDIDO DE DILAÇÃO DE PRAZO" } [5]= array(19) { ["IdProcessoEvento"]= string(30) "711263991150788270420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "3" ["DataHora"]= string(19) "20/01/2010 10:50:05" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(4) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263991150788270420000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(4) "DECL" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [6]= array(19) { ["IdProcessoEvento"]= string(30) "711263955058688620420000000001" ["IdEvento"]= string(3) "228" ["IdTipoPeticaoJudicial"]= string(2) "52" ["SeqEvento"]= string(1) "2" ["DataHora"]= string(19) "20/01/2010 00:40:39" ["SinExibeDesEvento"]= string(1) "N" ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "4" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["CodEvento"]= string(10) "0000000852" ["DesEvento"]= string(27) "PETIÇÃO PROTOCOLADA JUNTADA" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(6) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [4]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000005" ["SeqDocumento"]= string(1) "5" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [5]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711263229632249660420000000006" ["SeqDocumento"]= string(1) "6" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(7) "PETIÇÃO" ["DescricaoCompleta"]= string(7) "PETIÇÃO" } [7]= array(19) { ["IdProcessoEvento"]= string(30) "711262958983115560390000000001" ["IdEvento"]= string(3) "430" ["IdTipoPeticaoJudicial"]= NULL ["SeqEvento"]= string(1) "1" ["DataHora"]= string(19) "08/01/2010 12:04:47" ["SinExibeDesEvento"]= NULL ["SinUsuarioInterno"]= string(1) "N" ["IdGrupoEvento"]= string(1) "0" ["SinVisualizaDocumentoExterno"]= string(1) "N" ["Complemento"]= NULL ["DesEventoSemComplemento"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["CodEvento"]= string(6) "030101" ["DesEvento"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DesAlternativaEvento"]= NULL ["Usuario"]= string(13) "picinini.masp" ["idUsuario"]= string(30) "711262951173995330420000000001" ["Documento"]= array(4) { [0]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000001" ["SeqDocumento"]= string(1) "1" ["SigTipoDocumento"]= string(4) "PORT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [1]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000002" ["SeqDocumento"]= string(1) "2" ["SigTipoDocumento"]= string(4) "OFIC" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [2]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000003" ["SeqDocumento"]= string(1) "3" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } [3]= array(6) { ["IdUsuario"]= string(30) "711262951173995330420000000001" ["IdDocumento"]= string(30) "711262956008922510390000000004" ["SeqDocumento"]= string(1) "4" ["SigTipoDocumento"]= string(3) "OUT" ["IdSigilo"]= string(1) "0" ["DesSigilo"]= string(10) "Sem Sigilo" } } ["DesPeticao"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" ["DescricaoCompleta"]= string(56) "Distribuição/Atribuição Ordinária por sorteio eletrônico" } } ["ValCausa"]= string(4) "0.00" ["OrgaoJul"]= string(45) "JUÍZO FED. DA 02A VF CRIMINAL DE PORTO ALEGRE" ["CodOrgaoJul"]= string(9) "RS0000085" ["OrgaoColegiado"]= NULL ["CodOrgaoColegiado"]= NULL ["CodOrgaoColegiadoSecretaria"]= NULL } }

    Read the article

  • PHP - "tabulate" array - make levels from elements

    - by Moha
    If I have an array like this: Array ( [0] => field_schools [1] => und [2] => 0 [3] => field_school [4] => und [5] => 0 [6] => value ) How can I make an array like this from it? array ( [field_schools] => array ( [und] => array ( [0] => array ( [field_school] => array ( [und] => array ( [0] => array ( [value] => something ) ) ) ) ) ) ) I want to specify the 'value' myself.

    Read the article

  • Length of array (C) [migrated]

    - by physics
    I have an array of 10 elements. This array stocks some informations but last information is ended by an symbol "END" (which is -1). for exemple: array[0] = 1; array[1] = 1; array[2] = 1; array[3] = 1; array[4] = 1; array[5] = 1; array[6] = END; So in this case the length is 7 instead of 10. Here is my algorithm: for (i = 0; (i < 10) && (array[i] != END); i++) { ; } at the end i contains the length. Is it correct or there is an other methode?

    Read the article

  • Compare two associative arrays and create a new array with the matched arrays, PHP

    - by user194630
    I have this two arrays: $arr1=array( array("id" => 8, "name" => "test1"), array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); $arr2=array( array("id" => 3), array("id" => 4) ); How can i "extract" arrays from $arr1, where id have same value in $arr2, into a new array and leave the extracted array also in a new array, without taking into account key orders? The output i am looking for should be: $arr3=array( array("id" => 8, "name" => "test1") ); $arr4=array( array("id" => 4, "name" => "test2"), array("id" => 3, "name" => "test3") ); Thanks

    Read the article

  • Array Unique in two dimentional array in PHP

    - by Kaiser
    Hi I have an array that looks like this : Array ( [0] => Array ( [x] => 01 [y] => 244 ) [1] => Array ( [x] => 02 [y] => 244 ) [2] => Array ( [x] => 03 [y] => 244 ) [3] => Array ( [x] => 04 [y] => 243 ) [4] => Array ( [x] => 05 [y] => 243 ) [5] => Array ( [x] => 05 [y] => 244 ) [6] => Array ( [x] => 06 [y] => 242 ) [7] => Array ( [x] => 06 [y] => 243 ) [8] => Array ( [x] => 07 [y] => 243 ) [9] => Array ( [x] => 08 [y] => 243 ) [10] => Array ( [x] => 09 [y] => 242 ) [11] => Array ( [x] => 10 [y] => 244 ) [12] => Array ( [x] => 12 [y] => 243 ) [13] => Array ( [x] => 13 [y] => 243 ) [14] => Array ( [x] => 13 [y] => 243 ) [15] => Array ( [x] => 15 [y] => 243 ) ) x represent days and y values of a certain variable. I would like to display an array of unique days x ( last element ) and values y pragmatically. for example day 6 I have two y values but I want to display only the last one ( 243 ). Thanks for help

    Read the article

  • Array Unique in two dimensional array in PHP

    - by Kaiser
    Hi I have an array that looks like this : Array ( [0] => Array ( [x] => 01 [y] => 244 ) [1] => Array ( [x] => 02 [y] => 244 ) [2] => Array ( [x] => 03 [y] => 244 ) [3] => Array ( [x] => 04 [y] => 243 ) [4] => Array ( [x] => 05 [y] => 243 ) [5] => Array ( [x] => 05 [y] => 244 ) [6] => Array ( [x] => 06 [y] => 242 ) [7] => Array ( [x] => 06 [y] => 243 ) [8] => Array ( [x] => 07 [y] => 243 ) [9] => Array ( [x] => 08 [y] => 243 ) [10] => Array ( [x] => 09 [y] => 242 ) [11] => Array ( [x] => 10 [y] => 244 ) [12] => Array ( [x] => 12 [y] => 243 ) [13] => Array ( [x] => 13 [y] => 243 ) [14] => Array ( [x] => 13 [y] => 243 ) [15] => Array ( [x] => 15 [y] => 243 ) ) x represent days and y values of a certain variable. I would like to display an array of unique days x ( last element ) and values y pragmatically. for example day 6 I have two y values but I want to display only the last one ( 243 ). Thanks for help

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >