Navigation

    cpp-logo

    C++ Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Groups
    1. Home
    2. Popular
    Log in to post
    • All categories
    • Ankündigungen
    •      Die Artikel
    • C++ (alle ISO-Standards)
    •      MFC
    •      VCL (C++ Builder)
    •      C++/CLI mit .NET
    •      Andere GUIs - Qt, GTK+, wxWidgets
    • Sonstige Programmiersprachen
    •      C (alle ISO-Standards)
    •      C# und .NET
    •      Java
    •      Assembler
    •      Webzeugs
    • Betriebssysteme
    •      WinAPI
    •      Linux/Unix
    •      Projekt: OS-Development
    •      DOS und Win32-Konsole (nur Lesen)
    • Weitere Fachbereiche
    •      Mathematik und Physik
    •      Spiele-/Grafikprogrammierung
    •      Datenbanken
    •      Compiler- und IDE-Forum
    •      Projekte
    • Jenseits der Programmierung
    •      Beruf und Ausbildung
    •      Stellenangebote
    •      Themen rund um die IT
    •      Gaming-Corner
    • Forentechnik
    • Archiv
    •      Das C++ Magazin
    •          Die Redaktion
    •          Die Autoren
    •          Allgemeines zum Magazin
    •          Archiv
    •      Organisation des Forumtreffens
    •      FAQs - Frequently Asked Questions
    •          FAQ - C (C89, C99 und C11)
    •          FAQ - Assembler
    •          FAQ - C++ (auch C++0x, C++11)
    •          FAQ - C++/CLI
    •          FAQ - C++ Builder (VCL/CLX)
    •          FAQ - C# und .NET
    •          FAQ - Compiler & IDEs
    •          FAQ - Datenbanken
    •          FAQ - DOS und Win32-Konsole
    •          FAQ - Grafik-/Spieleprogrammierung
    •          FAQ - GUIs
    •          FAQ - Java
    •          FAQ - Linux/Unix
    •          FAQ - Mathematik und Physik
    •          FAQ - MFC
    •          FAQ - Rund um die Programmierung
    •          FAQ - Sonstiges
    •          FAQ - Webzeugs
    •          FAQ - WinAPI
    •          FAQ - Forentechnik
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All Time
    • Day
    • Week
    • Month

    • M

      Kompilieren einer shared library
      C++ (alle ISO-Standards) • • maxx12345  

      6
      0
      Votes
      6
      Posts
      62
      Views

      @maxx12345 sagte in Kompilieren einer shared library: By not providing "FindEXIV2.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "EXIV2", but CMake did not find one. Gemacht??
    • U

      Wortsuche in einem Text, mit zusätzlicher Schleife
      C++ (alle ISO-Standards) • • ulle1749  

      2
      0
      Votes
      2
      Posts
      30
      Views

      #include <cstddef> // std::size_t #include <cstring> // std::strcpy() #include <string> // std::string, std::getline() #include <iostream> // std::cin, std::cout int main() { constexpr std::size_t whole_input_size { 820 }; // 820 bytes =~ 0.8 * 1024 bytes + 1 for terminating zero char whole_input[whole_input_size] {}; std::size_t whole_input_length {}; char const * const word_to_find { "Tastatur" }; for (std::string line; whole_input_length < whole_input_size - 1 && std::getline(std::cin, line) && line.length();) { // append line to whole_input buffer: line += "\r\n"; std::size_t whole_input_space_left = whole_input_size - 1 - whole_input_length; std::size_t num_chars_to_copy = line.length() <= whole_input_space_left ? line.length() : whole_input_space_left; std::strncpy(whole_input + whole_input_length, line.c_str(), num_chars_to_copy); whole_input_length += num_chars_to_copy; // find word_to_find: if (line.find(word_to_find) != std::string::npos) { std::cout << '"' << word_to_find << "\" found in the last line entered :)\n\n"; break; } } // output whole_input: std::cout << "Your input:\n" << whole_input << '\n'; } Aber es ist wieder einmal eine ziemlich sinnfreie Aufgabe die ausdrücklich nicht wirklich schönes C++ und künstliche Beschränkungen fordert. Bitte besorg' Dir - falls Du nicht nur durch diese Vorlesung irgendwie durchkommen willst sondern wirklich was lernen willst - ein gutestm Lehrbuch. Threads über Bücher zu C++ findest Du hier im Forum zur Genüge.