Garmaine Staff asked 2 years ago

The little code I have compiles fine but when I go to run IntVector.cpp I get literally thousands of warnings like the following:

 IntVector:3:1533: warning: null character ignored [-Wnull-character]
 IntVector:8:3: warning: null character ignored [-Wnull-character]
 ?IntVector:9:2415: warning: null character ignored [-Wnull-character]

And so on. This is my first time trying to run a C++ program so I suppose the problem could be in my setup. I'm on Mac and using Emacs to code and compile and terminal to run it.


#include <iostream>
#include "IntVector.h"
#include <cmath>
using namespace std;

  int* array = new int[0];
  int num_elements;
  int array_size;
  int expansion_factor;

void IntVector::expandArray(){

void IntVector::add(int val){

    cout << "Hello"; 
void IntVector::remove(int index){   
int IntVector::get(int index) const{
    return index;
void IntVector::removeLast(){
void IntVector::set(int index, int val){

std::string IntVector::toString()const {
    return "";

IntVector::IntVector(int initial_size){


IntVector:: ~IntVector(){}

int main(){

  IntVector v(5);



#ifndef INTVECTOR_H_
#define INTVECTOR_H_

using std::cout;
class IntVector {
  int* array;
  int num_elements;
  int array_size;
  int expansion_factor;
  void expandArray();
  void add(int val);
  void remove(int index);
  int get(int index) const;
  void removeLast();
  void set(int index, int val);
  std::string toString() const;
  IntVector(int initial_size);