C Error New Undeclared
Contents |
here for a quick overview of the site Help Center Detailed c error undeclared (first use in this function) answers to any questions you might have Meta Discuss the undeclared identifier error in c workings and policies of this site About Us Learn more about Stack Overflow the company
Error Null Undeclared
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join
Malloc C
the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up C program - Structure marked as undeclared in compiler up vote 0 down vote favorite I am trying to write a program to collect security information about a file and convert it to human readable information. However, I am facing a problem with initializing a pointer to structure: #include
= new char[len+1] (with len being defined, no worries there), I get the 'undeclared identifier' compile error: 'new' undeclared (first use in this function) Somehow, this scares me, since I think I used the operator correctly. Edit: I hate how Google gives me no results before writing posts here and how it brings me exactly what I needed after I've posted the post. I just used malloc and free instead: 1
2
char *numbuffer; numbuffer = (char*) malloc(len+1); //len is defined beforehand http://stackoverflow.com/questions/10764969/c-program-structure-marked-as-undeclared-in-compiler and in the function that calls the one which contains the snippet above: 1
2
3
char *strTrainno = getTrainno(buffer); //getTrainno is the name of the function mentioned above, buffer a parameter passed to the current fn //do stuff with strTrainno free(&strTrainno); Last edited on Jul 25, 2008 at 12:42pm UTC Jul 25, 2008 at 11:58pm UTC guestgulkan (2942) Just out of interest http://www.cplusplus.com/forum/beginner/3177/ have you thought about why new didn't work or gave that error?? Jul 28, 2008 at 6:22am UTC toshiro (51) I guess I forgot to #include
from GoogleSign inHidden fieldsSearch for groups or messages
UML JavaPlateforme et langage Java Java Java Web Spring Android Eclipse NetBeans .NETMicrosoft Framework .NET Microsoft DotNET Visual Studio ASP.NET C# VB.NET Windows Phone Microsoft Azure Dév. WebDéveloppement Web et Webmarketing Développement Web AJAX Apache ASP CSS Dart Flash / Flex JavaScript PHP Ruby & Rails TypeScript Web sémantique Webmarketing (X)HTML EDIEnvironnements de Développement Intégré EDI 4D Delphi Eclipse LabVIEW NetBeans MATLAB Scilab Visual Studio WinDev Visual Basic 6 Lazarus Qt Creator ProgrammationProgrammation et langages de programmation applicatifs Programmation Débuter - Algorithmique 2D - 3D - Jeux Assembleur C C++ Go Objective C Pascal Perl Python Swift Qt XML Autres SGBDSystèmes de Gestion de Bases de Données SGBD & SQL 4D Access Big Data DB2 Firebird InterBase MySQL NoSQL PostgreSQL Oracle Sybase SQL-Server OfficeBureautique pour l'entreprise Microsoft Office Access Excel Word Outlook PowerPoint SharePoint Microsoft Project OpenOffice & LibreOffice Solutions d'entrepriseAutres logiciels pour l'entreprise Solutions d'entreprise Big Data BPM Business Intelligence ERP / PGI CRM SAS Cloud Computing SAP Microsoft BizTalk Server Talend IBM Bluemix ApplicationsApplications logicielles Applications Libres & Open Source OpenOffice & LibreOffice Projets MobilesLogiciels et matériels mobiles Mobiles Android iOS Windows Phone SystèmesLogiciels et matériels systèmes Systèmes Windows Linux Sécurité Hardware Mac Raspberry Pi Réseau Green IT Systèmes Embarqués Virtualisation Programmation Algorithmique 2D-3D-Jeux Assembleur C C++ Go Objective C Pascal Perl Python Swift Qt XML Autres Accueil C Forums C FAQ C Tutoriels C Livres C Compilateurs et outils C Sources C Bibliothèques C GTK+ S'inscrire Aide Quoi de neuf ? Forum Actions Marquer les forums comme lus Bugs & Suggestions Réseau social Groupes Liste des utilisateurs FAQ forum Voir l'équipe du site Blogs Agenda Règles Blogs Projets Recherche avancée Index du forum C et C++ C Réseau error: `new' undeclared (first use in this function) + Répondre à la discussion Discussion: error: `new' undeclared (first use in this function) Outils de la discussion Afficher une version imprimable S'abonner à cette discussion… Affichage Mode linéaire Choisir le mode hybride Choisir le mode