Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. can anyone help me to solve this error?

can anyone help me to solve this error?

Scheduled Pinned Locked Moved Mobile
helpquestion
4 Posts 4 Posters 38 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_15796466
    wrote on last edited by
    #1

    import 'package:flutter/material.dart';
    import './practice2.dart';
    import './practice3.dart';
    void main()
    {
    runApp(MaterialApp(home:Akanksha()));
    }
    class Akanksha extends StatefulWidget {
    @override
    State createState() {
    return AkankshaState();
    }
    }

    class AkankshaState extends State{
    final questions=const[
    {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
    },
    {'questionText':'what is your fav drama?','answers':['black','green','blue'],
    },
    {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
    },
    ];
    var _questionIndex=0;
    void answerQuestion(){
    // var aBool=true;
    // aBool=false;
    setState((){
    _questionIndex= _questionIndex+1;
    });
    print(_questionIndex);
    if (_questionIndex

    import 'package:flutter/material.dart';
    import './practice2.dart';
    import './practice3.dart';
    void main()
    {
    runApp(MaterialApp(home:Akanksha()));
    }
    class Akanksha extends StatefulWidget {
    @override
    State createState() {
    return AkankshaState();
    }
    }

    class AkankshaState extends State{
    final questions=const[
    {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
    },
    {'questionText':'what is your fav drama?','answers':['black','green','blue'],
    },
    {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
    },
    ];
    var _questionIndex=0;
    void answerQuestion(){
    // var aBool=true;
    // aBool=false;
    setState((){
    _questionIndex= _questionIndex+1;
    });
    print(_questionIndex);
    if (_questionIndex

    L D E 3 Replies Last reply
    0
    • M Member_15796466

      import 'package:flutter/material.dart';
      import './practice2.dart';
      import './practice3.dart';
      void main()
      {
      runApp(MaterialApp(home:Akanksha()));
      }
      class Akanksha extends StatefulWidget {
      @override
      State createState() {
      return AkankshaState();
      }
      }

      class AkankshaState extends State{
      final questions=const[
      {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
      },
      {'questionText':'what is your fav drama?','answers':['black','green','blue'],
      },
      {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
      },
      ];
      var _questionIndex=0;
      void answerQuestion(){
      // var aBool=true;
      // aBool=false;
      setState((){
      _questionIndex= _questionIndex+1;
      });
      print(_questionIndex);
      if (_questionIndex

      import 'package:flutter/material.dart';
      import './practice2.dart';
      import './practice3.dart';
      void main()
      {
      runApp(MaterialApp(home:Akanksha()));
      }
      class Akanksha extends StatefulWidget {
      @override
      State createState() {
      return AkankshaState();
      }
      }

      class AkankshaState extends State{
      final questions=const[
      {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
      },
      {'questionText':'what is your fav drama?','answers':['black','green','blue'],
      },
      {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
      },
      ];
      var _questionIndex=0;
      void answerQuestion(){
      // var aBool=true;
      // aBool=false;
      setState((){
      _questionIndex= _questionIndex+1;
      });
      print(_questionIndex);
      if (_questionIndex

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What error? Just dumping a load of code does not help us to discover what your problem is. Please edit your question and add full details of the problem.

      1 Reply Last reply
      0
      • M Member_15796466

        import 'package:flutter/material.dart';
        import './practice2.dart';
        import './practice3.dart';
        void main()
        {
        runApp(MaterialApp(home:Akanksha()));
        }
        class Akanksha extends StatefulWidget {
        @override
        State createState() {
        return AkankshaState();
        }
        }

        class AkankshaState extends State{
        final questions=const[
        {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
        },
        {'questionText':'what is your fav drama?','answers':['black','green','blue'],
        },
        {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
        },
        ];
        var _questionIndex=0;
        void answerQuestion(){
        // var aBool=true;
        // aBool=false;
        setState((){
        _questionIndex= _questionIndex+1;
        });
        print(_questionIndex);
        if (_questionIndex

        import 'package:flutter/material.dart';
        import './practice2.dart';
        import './practice3.dart';
        void main()
        {
        runApp(MaterialApp(home:Akanksha()));
        }
        class Akanksha extends StatefulWidget {
        @override
        State createState() {
        return AkankshaState();
        }
        }

        class AkankshaState extends State{
        final questions=const[
        {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
        },
        {'questionText':'what is your fav drama?','answers':['black','green','blue'],
        },
        {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
        },
        ];
        var _questionIndex=0;
        void answerQuestion(){
        // var aBool=true;
        // aBool=false;
        setState((){
        _questionIndex= _questionIndex+1;
        });
        print(_questionIndex);
        if (_questionIndex

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        In addition to what Richard said, when editing your post, please remove any unnecessary code. Just post what is relevant to the actual problem. All else is just noise.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        1 Reply Last reply
        0
        • M Member_15796466

          import 'package:flutter/material.dart';
          import './practice2.dart';
          import './practice3.dart';
          void main()
          {
          runApp(MaterialApp(home:Akanksha()));
          }
          class Akanksha extends StatefulWidget {
          @override
          State createState() {
          return AkankshaState();
          }
          }

          class AkankshaState extends State{
          final questions=const[
          {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
          },
          {'questionText':'what is your fav drama?','answers':['black','green','blue'],
          },
          {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
          },
          ];
          var _questionIndex=0;
          void answerQuestion(){
          // var aBool=true;
          // aBool=false;
          setState((){
          _questionIndex= _questionIndex+1;
          });
          print(_questionIndex);
          if (_questionIndex

          import 'package:flutter/material.dart';
          import './practice2.dart';
          import './practice3.dart';
          void main()
          {
          runApp(MaterialApp(home:Akanksha()));
          }
          class Akanksha extends StatefulWidget {
          @override
          State createState() {
          return AkankshaState();
          }
          }

          class AkankshaState extends State{
          final questions=const[
          {'questionText':'what is your favourite colour?','answers':['black','green','blue'],
          },
          {'questionText':'what is your fav drama?','answers':['black','green','blue'],
          },
          {'questionText':'what is your favourite animal?','answers':['black','green','blue'],
          },
          ];
          var _questionIndex=0;
          void answerQuestion(){
          // var aBool=true;
          // aBool=false;
          setState((){
          _questionIndex= _questionIndex+1;
          });
          print(_questionIndex);
          if (_questionIndex

          E Offline
          E Offline
          Emilia Baker
          wrote on last edited by
          #4

          Hi, it seems like you are getting an error because you are not using the correct namespace or scope for cout. cout is defined within the std namespace, so you need to either use std::cout or add a using namespace std; directive before your main function. For example:

          #include
          using namespace std;

          int main()
          {
          cout << "Hello world";
          return 0;
          }

          or

          #include

          int main()
          {
          std::cout << "Hello world";
          return 0;
          }

          You can read more about namespaces and cout here:https://stackoverflow.com/questions/15359589/cout-is-not-a-member-of-std-cout-was-not-declared-in-this-scope[^], 'cout' was not declared in this scope [FIXED][^] or https://stackoverflow.com/questions/15185801/cout-was-not-declared-in-this-scope[^] Best regards, Mia from CodeIT

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups