前提・実現したいこと
プログラミング初心者です。
C++でのコンパイルエラーの解決をしたいです。
発生している問題・エラーメッセージ
‘strchr’ was not declared in this scope while ( is.get(c) && ! strchr(dcs, c) )
該当のソースコード
C++
1// 2// sdfDataTypes 3// 4#ifndef _SDF_DATA_TYPES_H_ 5#define _SDF_DATA_TYPES_H_ 6 7#include "common/PointSet.h" 8#include "common/PolygonalMesh.h" 9#include "utilMath.h" 10#include <string> 11#include <iostream> 12 13 14namespace SDF { 15 typedef float FVec3[3]; 16 17 struct Crd { 18 float x, y, z; 19 Crd(const float a =0.f, const float b =0.f, const float c =0.f) 20 : x(a), y(b), z(c) {} 21 Crd(const Crd& o) {*this = o;} 22 }; 23 24 struct TriElm { 25 int x, y, z; 26 TriElm(const int a =0, const int b =0, const int c =0) 27 : x(a), y(b), z(c) {} 28 TriElm(const TriElm& o) {*this = o;} 29 }; 30 31 32 inline void GetLine(std::istream& is, std::string& buff) { 33 char c; 34 const char dcs[] = "\n\r"; 35 buff = ""; 36 while ( is.get(c) && ! strchr(dcs, c) ) 37 buff.push_back(c); 38 while ( is.get(c) && strchr(dcs, c) ) 39 ; 40 if ( is.good() ) is.putback(c); 41 } 42 43 extern std::string s_lastErrMsg; 44}; 45
試したこと
stringとstrchrについて調べました。
補足情報(FW/ツールのバージョンなど)
VWware horizon client 2012
回答2件
あなたの回答
tips
プレビュー