If you love Delphi so much give Lazarus a try. It's very similar.
Lazarus Homepage
Type: Posts; User: OldGuy2
If you love Delphi so much give Lazarus a try. It's very similar.
Lazarus Homepage
Why don't you use memset ?
memset(3): fill memory with constant byte - Linux man page
Have a closer look at line 5.
Do you want to print the address of the compare function?
There is no need for casting:
int compare(const void* i, const void* j)
{
return strcmp(i, k);...
It's normally bad practice to use global variables since the can get changed from all over the code and that can make debugging very hard, it doesn't matter if they are simple vars or structs.
It's...
What wrong results did you get, what input did you use?
Can you post the lastest code?
Imagine h == 2 and b == 3. Does 6 = flaeche make any sense?
Doesn't your textbook tell you how to assign values to a variable ?
One problem is on line 24: == is the comparison operator, but you should assign it to the var diagonale.
diagonale = sqrt(pow(h,2) + pow(b,2));
Same problem on line 31
How did you manage to...
On Windows under Visual Studio you can have structured exception handling for C.
Be aware that your code won't work on other compilers.
Structured Exception Handling (C/C++) | Microsoft Docs
Switching to Linux is a very big step. Why don't you try clang or even Pelles IDE first ?
It's very easy to use the STL containers in a poor way causing lots of allocations and deallocations and copying.
If you show us the code we might be able to show you better ways.
Forum - C++ Forum seems very popular
There is an overloaded version of stoi that accepst the base of the number.
const int HEX = 16;
stoi(num, nullptr, HEX)
stoi - C++ Reference
When using uint64_t you know that it is an unsigned 64 bit type.
What is unsigned long long int ? You can't answer it in general the size depends on the compiler and the architecturre 32/64 bit ot...
A few hints:
unsigned long long int
use uint64_t instead => include <cstdint>
Not valid in C++
Better use std::vector
Consider using std::set_intersection.
I guess you want the factors to be sorted and unique so best to store them in a std::set.
It's not really clear what you want to do.
Can you show us the expected output with some input?
A dll can have a DllMain function, not a main function, though it seems that it isn't necessary.
DllMain entry point | Microsoft Docs
PInvoke ( How to Call C from C# ) | Moy Blog
Easier way is iterate through the string from right to left.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
/*
Honestly, before writing such a game you should learn about string, struct and vector which would easily solve your problems with the variables.
struct QuizEntry // one variable for each...
What's the point of this code?
By using a std::vector there would be no need to worry about copy/move semantics and memory leaks.
scanf leaves '\n' in the input buffer, that's what getchar reads so it doesn't stop for input.
To fix put another getchar after the last scanf.
That's true, however you might get more useful answers if you clearly tell us what you want to do in plain English.
It also will help you to understand the problem if you write some pseudo code in...
Out of curiosity: Why so complicated ?
The task could easily be done like this:
#include <iostream>
#include <string>
#include <list>
using namespace std;
One way is to check the return value from scanf:
int num;
if (scanf("%d", &num))
{
puts("Valid input");
}
else
{
Some other ideas:
1. embed the images as resources in your .exe file.
2. deliver the images together with your .exe file
3. store the images on the web and download them - if you can rely...