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. General Programming
  3. Managed C++/CLI
  4. Error On a Project I'm Working On. (Sorry If Not descriptive enough, 1st time)

Error On a Project I'm Working On. (Sorry If Not descriptive enough, 1st time)

Scheduled Pinned Locked Moved Managed C++/CLI
helpc++
2 Posts 1 Posters 6 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi so this is my first post here, I'm having the following problem ---------------------------------------------------------------------------------------------------- 6 11 E:\Trabalhos\Programação\Projeto\Projeto.cpp [Error] expected constructor, destructor, or type conversion before '(' token ---------------------------------------------------------------------------------------------------- Here's the code:

    #include
    #include
    #include
    using namespace std;

    setlocale (LC_ALL, "Portuguese");

    ofstream ficheiro ("Info Trabalhador");

    int x, i,a,b,d;

    int esc[4] = {100, 150, 200, 250};

    struct trab
    {
    char nome[100];
    char morada[200];
    int numero;
    int telefone;
    };

    trab f;

    int salario(int n1,int n2){
    int money;
    money = n1*n2;
    return money;
    }

    void menu1 (){
    cout<<" * * * * * * * * * * * * * * * * * * * *"<>x;
    cout<>f.nome;
    cout<>f.morada;
    cout<>f.numero;
    cout<>f.telefone;
    cout<>a;
    cout<>b;
    if (a == 1)
    {
    d=100;
    cout<<"Deve Receber: "<

    L 1 Reply Last reply
    0
    • L Lost User

      Hi so this is my first post here, I'm having the following problem ---------------------------------------------------------------------------------------------------- 6 11 E:\Trabalhos\Programação\Projeto\Projeto.cpp [Error] expected constructor, destructor, or type conversion before '(' token ---------------------------------------------------------------------------------------------------- Here's the code:

      #include
      #include
      #include
      using namespace std;

      setlocale (LC_ALL, "Portuguese");

      ofstream ficheiro ("Info Trabalhador");

      int x, i,a,b,d;

      int esc[4] = {100, 150, 200, 250};

      struct trab
      {
      char nome[100];
      char morada[200];
      int numero;
      int telefone;
      };

      trab f;

      int salario(int n1,int n2){
      int money;
      money = n1*n2;
      return money;
      }

      void menu1 (){
      cout<<" * * * * * * * * * * * * * * * * * * * *"<>x;
      cout<>f.nome;
      cout<>f.morada;
      cout<>f.numero;
      cout<>f.telefone;
      cout<>a;
      cout<>b;
      if (a == 1)
      {
      d=100;
      cout<<"Deve Receber: "<

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

      You are declaring local executable statements outside functions which is incorrect. You should move then inside an appropriate function, probably main.

      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