There are many libraries in C++, but how are they made?
For example: SDL, SFML, Open CV, STK
There are no special functions in C++ from which we can create such libraries, If I wanted to create a library that processes sound signals, how would I do that? How can I access the mic, speakers and process the signals.
Open CV processes videos but which functions does it use?
I just started learning C++ a week ago and have been stuck on a project for the past 2 days now. I am building a limited purpose calculator which finds the value of one of five operations. Visual studio doesn't underline any errors in my program but every time I try to run it I get an error message. I believe it has something to do with the if/else but Im not sure.
#include <iostream> using namespace std; int main(){ int a; int b; int sum = a + b;
I have an array in a class with some numbers in a specific order. Now I want to create a set with references to that array ordered after the arrays content. I thought a solution could be something like
class Holder { int o[10]= {1,5,7,2,3,8,4,9,6,0}; public: set<int,my_order> m_s; Holder() { for(int i=0; i<10;i++) { m_s.insert(i);
The value -1 at the end of each line does not mean anything but I need to keep it.
Finally LIST3 tells me if the points are connected counterclockwise (-1), clockwise (1), or coolinear (0).
The thing is that I want to get things as follows:
If the values of list 3=1 then I need to extract all the points in the list 1 that correspond to the value 1 in order. However the values in LIST2 cannot keep being 1, 4, 2,-1 they need to be reorganised starting by zero. Expected result in LIST2= 0,3,1,-1.
We need to do this for each value in list3 (1,-1 and 0).
The idea is to get 3 groups of values:
- Group 1 including all the values that are clockwise (list3) with the points in order in list1 and showing connections starting from zero on in list2.
- Group 2 including all the values that are counterclockwise (list3) with the points in order in list1 and showing connections starting from zero on in list2.
- Group 3 including all the values that are coolinear (list3) with the points in order in list1 and showing connections starting from zero on in list2.
The idea is to be able to print 3 files in the following way:
Exercise. 1.5 A number is special if it is divisible (no remainder) by 15. A number is big if it is greater than 999. A number is weird if it is divisible by 5 and 6 but not 18. A number is scary if it is big or weird.
Write a program to check which of the following, 450, 540, 600, and 675 are special but not scary.
Declare four variables called special, big, weird, and scary and make suitable assignments to these variables as a number is tested.
I want to do it with a function, but it just output that everything is Special and Scary, and that everything values 4199536.
Code: #include <stdio.h> #include <stdlib.h> /* Function */ int test(int); int test(int a) { int sc, sp;
I'd like to use the Big Integer Library [URL], but I have issues to use it. I'm using Xcode as compiler and I don't know how to include the library in my project files. When I drag all the files in the project directory and write the statement #include <BigInteger.hh> on the top of the declaration of the main function, even whiteout any other code, I get lots of build error on the .hh and .cc file.
I have written library in c++ for c++ application. Here, data exchange between library and client through structure. This structure has 20 members ( strings, integers, reals, pointers).
In some flows, library needs few members should get filled in the structure. for ex, application filled 3 integers information and passed to structure. But, in memory, whole structure is occupied.
I think, If library provides functions for every combination, then it would end up with lot of functions. I want to avoid that.
How to optimize data exchange between client and library? ( number of members may be filled sometimes 1, 2, 3, .. 20)
I have a file that contain different content, some lines inside that file looks like that :
Time : xx:xx:xx Time : xx:xx:xx
So, I want to grab lines that start with "Time : " and put them inside a list<string> for later use. I am using windows so I don't know if the newline character is ' ' or ' ' also I don't want my grabed line contain any special character.
I have this code, but didn't work well because some special characters remain inside the string.
Is there any way to do date math using standard C libraries? I looked around in the time.h but didn't see what I needed.
What I need to do is be able to add a certain number of minutes to a date and have it give the current date/time. For example, add 15918765 minutes to 01/01/1980 00:00 and have it tell me 04/07/2010 4:45PM. I really don't want to write this myself or go platform-specific.
I know I can use -isystem path to mark a path as containing system headers which shouldn't be included when generating warnings, and this works, but it doesn't work when the warnings are generated by instantiating templates from the library in my source code. Is there any way to ignore these template-instantiation-generated warnings too?
I'm trying to create a GUI with Open graphics Libraries.I have made a basic GUI that exits the program or shows the instructions if a option/Polygon is marked (A bigger one is behind them)But what I'm trying to do now is the following:
0. Start the direct access on the desktop 1. Screen: Press any key to continue 2. Select one option 2.1 Option one: Go to the circuit selection menu 2.1 Option two: View the instructions (Cleared) 2.1 Option three: Exit the game (Cleared) 3. Select a circuit 4. Go to the car selection menu 5. Select a car and start the race 6. Pause menu if Spacebar has been pressed
From the pause menu:
6.1. Go to the main menu 6.2. Restart the race 6.3. Exit
I know that it is OpenGL, but what i'm looking for is C++.How I could do that? What I have cleared is with IF but I'm looking for better alternatives.
I want to write a small game library that uses GLFW.
So I have for example a window class that uses GLFW functions.
To do that my window class must include the GLFW header files.But I don't want, that if I use my library later and I include my window class, that all GLFW functions are included, too.
How I can prevent this and hide GLFW from users of this library completely, so they theoretical don't notice that this library use GLFW ?
And a second question, is it possible, if I export my game library statically that the GLFW lib files are hidden in my own lib files, so that I have finally only one lib file that is needed to use my library ?
I am a beginner and I ALWAYS have the toughest time doing I/O files. It's extremely frustrating. It "seems" it should be so simple. The program should find a code from a list of numbers. These numbers are from 0 - 9, and after each number is a space in the file. Your job is to extract a special code containing only 10 of those numbers. For the number to be part of the code, it should be divisible by 2. After extracting 10 numbers divisible by 2 for the code, write those 10 numbers to the file to form the expected code.
Input file is ("question.txt") Output should be ("code.txt")
Should this contain a "for loop" or If/else ?
Here's what I did . .
/ // int numbers, total, counter; ifstream inFile; inFile.open ("question.txt"); outFile.open ("code.txt"); if (!inFile)
How can I pass ":" or " " as an argument to a process?
I start a process which takes an IP and port number (ex 222.240.224.131:80) as argument. Another character that I want to pass is white space character. Both of these characters cuts the argument string and sends only the part that leads them.
I've worked a lot in Java and Perl and now I'm learning C++ and working on a simple e-reader (let's not get into why I'm not just using Kindle or other existing ones). This is for me and a number of friends.
At first my project will be on OS X, then Windows and Linux, and I hope to eventually use it on Android and iOS. I know that the last two will require separate GUIs, but I'm hoping the rest of the code will port easily.
Here's the problem:
I'm using Poppler to read and display PDF files. I started installing it on my iMac and it needs FontConfig, which is turning out to be a difficult install. I would not want to walk others through this or make them have to install Poppler and FontConfig (and any other libraries I find both need).
I thought I could just compile my final binaries using "-static" but I've been reading about how some libraries can't be statically linked or compiled.
Also, since I want to eventually port this to 4 other OSes (and apparently Poppler can work on those target OSes), I don't want to do something now or depend on something that will make it hard or impossible to port to other OSes later.
With that in mind, here are my questions:
1) Why is it some libraries cannot be compiled statically? How do I know if I'm dealing with one of those libraries?
2) Am I right that I could compile this program statically, and the resulting binary would include code from Poppler and FontConfig and other libraries would be included in the resulting executable binary?
3) What do I need to watch for so I can tell if using a particular library will be a problem when I need to port my program to a new OS? (Assuming, of course, that searching shows that library will compile or has been ported to that OS.)
I have been trying to compile a static version of the boost libraries, however when I try to launch the program it says fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-s-1_53.lib'
I have checked in the boost/stage/lib folder and that file is not there. I compiled boost with b2 link=static yet the file still isn't there.