Hi!
i cant get this code to work, I get error c2065, undeclared identifier for some reason don´t really know why...
this results in error C2146: syntax error : missing ';' before identifier 'Sorter'
and error C2065: 'Sorter' : undeclared identifier....
furthermore, I am not sure that my sorter will work (later problem =))
And I hope here is a kind soul that can help me out =)
the code:
#include <iostream>
#include <string>
#include<cstdli b>
using namespace std;
int main(){
ArraySorter Sorter; // <-- c2065
return 0;
}
#pragma once
#include<string >
class ArraySorter
{
public:
ArraySorter(voi d);
void ISort(char *[], int );
~ArraySorter(vo id);
private:
};
------------------------------------------------------ArraySorter.cpp
#include "ArraySorte r.h"
#include<string >
ArraySorter::Ar raySorter(void) {
}
void ArraySorter::IS ort(char* skivor[], int antalSkivor){
int itr;
for(int i=1;i<antalSkiv or;i++){
//string name(skivor[i]);
char *temp= skivor[i];
itr=i-1;
while(strcmp(sk ivor[itr], temp)>0 && itr>=0){
skivor[itr+1]=skivor[itr];
itr--;
}
skivor[itr+1]=temp;
}
}
ArraySorter::~A rraySorter(void )
{
}
i cant get this code to work, I get error c2065, undeclared identifier for some reason don´t really know why...
this results in error C2146: syntax error : missing ';' before identifier 'Sorter'
and error C2065: 'Sorter' : undeclared identifier....
furthermore, I am not sure that my sorter will work (later problem =))
And I hope here is a kind soul that can help me out =)
the code:
#include <iostream>
#include <string>
#include<cstdli b>
using namespace std;
int main(){
ArraySorter Sorter; // <-- c2065
return 0;
}
#pragma once
#include<string >
class ArraySorter
{
public:
ArraySorter(voi d);
void ISort(char *[], int );
~ArraySorter(vo id);
private:
};
------------------------------------------------------ArraySorter.cpp
#include "ArraySorte r.h"
#include<string >
ArraySorter::Ar raySorter(void) {
}
void ArraySorter::IS ort(char* skivor[], int antalSkivor){
int itr;
for(int i=1;i<antalSkiv or;i++){
//string name(skivor[i]);
char *temp= skivor[i];
itr=i-1;
while(strcmp(sk ivor[itr], temp)>0 && itr>=0){
skivor[itr+1]=skivor[itr];
itr--;
}
skivor[itr+1]=temp;
}
}
ArraySorter::~A rraySorter(void )
{
}
Comment