Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6834155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:04:35+00:00 2026-05-26T23:04:35+00:00

my first.h: class skaiciavimas { public: vector<int> vekto[2]; skaiciavimas(); ~skaiciavimas(); …. my first.cpp #include

  • 0

my first.h:

class skaiciavimas
{
public:
    vector<int> vekto[2];
    skaiciavimas();
    ~skaiciavimas();
....

my first.cpp

    #include "skaiciavimas.h"

skaiciavimas::skaiciavimas()
{   int i;
    for(i=0;i<2;i++)
    vekto[i].resize(3);
}
void skaiciavimas::showst(vector<int> st,int i)
{   
    vekto[i].at(0)=st.at(0);
    vekto[i].at(1)=st.at(1);
    vekto[i].at(2)=st.at(2);
    cout<<vekto[1].at(0)<<vekto[0].at(0)<<endl;

}
void skaiciavimas::tikrinimas ()
{
    cout<<vekto[1].at(0)<<vekto[0].at(0)<<endl;// gives always 0,0
....

there is second class from where i call shwst function
second.cpp:

vandenynas::vandenynas()
{
    vektorV.resize(3);
}
void vandenynas::duomenys (int i, int a, int a0) 
{
        switch (i)
    {
        case 0:
            vektorV.at(0)=a-a0;
            break;
        case 1:
            vektorV.at(1)=a-a0;
            break;
        default:
            vektorV.at(2)=a-a0;
            break;

    }
 sk.showst(vektorV,0);
}

the tikrinimas function i call from my main:

sk.tikrinimas();

why this line

cout<<vekto[1].at(0)<<vekto[0].at(0)<<endl;

alvays gives me 00, how to correct that to get the rigt numbers wich were assign in showst

P.S sk is my class (first sk;)

there is called duomenys and tikrinimas :

vandenynas vand;
skaiciavimas sk;
int main() 
{
    int i,a,a0,t;
    int j=1;

    while (j<3)
    {
        for (i=0;i<3;i++)
        {   
          cout<<"enter "<<kas<<kint(i)<<" kordinates"<<endl;
          cout<<kint(i)<<"0 = ";
          cin>>a0;
          cout<<kint(i)<<" = ";
          cin>>a;
          cout<<endl;
          if (j==1)
              vand.duomenys(i,a,a0);            
         }
     j++;
    }
    sk.tikrinimas();
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:04:36+00:00Added an answer on May 26, 2026 at 11:04 pm
          cin>>a0;
    

    You read the input into local variables, but never call sk.showst with those values. It shouldn’t be surprising that it’s members are still whatever the defaults are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#include <iostream> using namespace std; // This first class contains a vector and a
Code goes first: class A { public: ... int *foo() const { return _px;
First class: class Main1 { private ExecutorService service = Executors.newFixedThreadPool(4); public static void main(String[]
My first class: <?php require_once( 'error/DisconnectedHandler.php' ); require_once( 'error/NoSuchRequestHandler.php' ); class NetworkManager { public
This is my first Class Hello.java public class Hello { String name = ;
i get the fallowing error when i compile program: vandenynas.cpp(19) error C2662: 'skaiciavimas::showst' :
First class which got the enum: public class EnumTest { private Employee empl; public
I have these classes: first: class C { public: C(const C& c):_s(c._s){} c():_s(){} string
I am developing flash game. first class: public class Game{ public var age; }
I'm creating my first class, mainly guided by Overland's C++ Without Fear. I've made

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.