X3eRo0
hey
X3eRo0
so i am using LoadImageW()
X3eRo0
to open an image and use it
X3eRo0
but i want to embed the image inside the program
X3eRo0
so that the file doesnt have to be present the pwd
X3eRo0
win32 api
X3eRo0
windows c++ in mingw env
X3eRo0
one idea that i have is that embed the bitmap in its raw format into a char array
X3eRo0
and then use this
X3eRo0
to like open a bitmap from a buffer
X3eRo0
https://stackoverflow.com/questions/2886831/win32-c-c-load-image-from-memory-buffer
X3eRo0
please answer
klimi
hi
Anonymous
hi
Álvaro
Can somebody tell me how to get the type name of a variable in C? (Not C++)
Álvaro
I tried typeof, typeid... But they are undefined, and if I try to include <typeinfo>, I can't...
Karthick
Karthick
I was researching the same from this eve.
Couldn't find any workable solution so far
Anonymous
Álvaro
+1
From discord:
You can't get types at runtime in C.
C doesn't use runtime typing, everything's just raw bytes.
Karthick
Any workaround to differentiate int and char would be helpful!
As I am writing a wrapper functions for db select query.
Without identifing type I have to use if/switch for every column.!
Any help welcome !
X3eRo0
Anonymous
X3eRo0
Virat Upadhyay
does any one have a Accenture pseudo code material?
Virat Upadhyay
plz help if possible!
Anonymous
#ot
Adib
anyone know russian group for programming or hacking ?
Dima
Adib
Dadaskis
Álvaro
Hi,
I need help marshalling a C struct into C#, I need to keep the 3rd dimension array called (byte[,,,]) dates.
c
struct __attribute__((__packed__)) mcmap_region_header //8KiB file header
{
struct mcmap_region_chunk_location locations[32][32]; //chunk (x,z)'s location atom is at locations[z][x] when x & z are positive; location[31-z][31-x] when negative
uint8_t dates[32][32][4]; //UNIX timestamps for when each chunk was last modified
};
I use [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32 * 32 * 4)] attr, without luck, I researched on Google, and I saw LPArray value from UnmanagedType enum, but there isn't any parameter to specify the dimensions:
cs
public struct McmapRegionHeader //8KiB file header
{
//public McmapRegionChunkLocation[,] Locations = new McmapRegionChunkLocation[32, 32]; //chunk (x,z)'s location atom is at locations[z][x] when x & z are positive; location[31-z][31-x] when negative
//public byte[,,] Dates = new byte[32, 32, 4]; //UNIX timestamps for when each chunk was last modified
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32 * 32)]
public McmapRegionChunkLocation[,] Locations; //chunk (x,z)'s location atom is at locations[z][x] when x & z are positive; location[31-z][31-x] when negative
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32 * 32 * 4)]
public byte[,,] Dates; //UNIX timestamps for when each chunk was last modified
}
Anonymous
Greetings, does anybody knows where can I found info about VHDL?
Ilya
Can somebody tell me how to get the type name of a variable in C? (Not C++)
This is impossible (even in c++).
To have variable type you must first form it during compile time and write to some other variable having correspondence with this variable, at start of the program.
This can be done ,f.e., in COM for some variables. So you will need something similar.
Actually if you really need this, this is an indicator that you do something very wrong.
Javi
Anonymous
Where is MADGUGULA
Khan
#include <stdio.h>
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin);
int main(){
int celcius,reamur,fahrenheit,kelvin;
printf("Masukkan derajat suhu CELCIUS yang akan dikonversi: ");
scanf("%d", &celcius);
printf("KONFERSI suhu: \nReamur: %d \nFahrenheit: %d \nKelvin: %d\n",reamur, fahrenheit, kelvin);
}
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin){
reamur = celcius*4/5;
fahrenheit = (celcius*9/5)+32;
kelvin = celcius + 273;
return reamur,fahrenheit,kelvin;
}
i'm a newbie and i'm trying to make function but i have something wrong here,the result is always same if i start the program
Anonymous
#include <stdio.h>
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin);
int main(){
int celcius,reamur,fahrenheit,kelvin;
printf("Masukkan derajat suhu CELCIUS yang akan dikonversi: ");
scanf("%d", &celcius);
printf("KONFERSI suhu: \nReamur: %d \nFahrenheit: %d \nKelvin: %d\n",reamur, fahrenheit, kelvin);
}
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin){
reamur = celcius*4/5;
fahrenheit = (celcius*9/5)+32;
kelvin = celcius + 273;
return reamur,fahrenheit,kelvin;
}
i'm a newbie and i'm trying to make function but i have something wrong here,the result is always same if i start the program
You didn't call the function
Anonymous
hii
Anonymous
#include <stdio.h>
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin);
int main(){
int celcius,reamur,fahrenheit,kelvin;
printf("Masukkan derajat suhu CELCIUS yang akan dikonversi: ");
scanf("%d", &celcius);
printf("KONFERSI suhu: \nReamur: %d \nFahrenheit: %d \nKelvin: %d\n",reamur, fahrenheit, kelvin);
}
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin){
reamur = celcius*4/5;
fahrenheit = (celcius*9/5)+32;
kelvin = celcius + 273;
return reamur,fahrenheit,kelvin;
}
i'm a newbie and i'm trying to make function but i have something wrong here,the result is always same if i start the program
And returning with comma operator doesn't work the way you think it works
Anonymous
You have a lack of some knowledge
Anonymous
Anonymous
Karthick
Javi
👍👍
Khan
what should i do?
Anonymous
Talula
#include <stdio.h>
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin);
int main(){
int celcius,reamur,fahrenheit,kelvin;
printf("Masukkan derajat suhu CELCIUS yang akan dikonversi: ");
scanf("%d", &celcius);
printf("KONFERSI suhu: \nReamur: %d \nFahrenheit: %d \nKelvin: %d\n",reamur, fahrenheit, kelvin);
}
int menghitungCelcius(int celcius,int reamur,int fahrenheit,int kelvin){
reamur = celcius*4/5;
fahrenheit = (celcius*9/5)+32;
kelvin = celcius + 273;
return reamur,fahrenheit,kelvin;
}
i'm a newbie and i'm trying to make function but i have something wrong here,the result is always same if i start the program
written in swift?
Anonymous
How to delete and free up memory taken by a vector object?
Artöm
Anonymous
But is there a way to delete the object instance in a vector? I would get an error if I do it because of double deletion
Artöm
Anonymous
The problem is let's say I create a vector of class A. And if I keep appending back to the vector. I would run out of memory
Anonymous
I was trying to find a way to delete / free up elements in my vector which I won't need
Talula
Delete the pointer.
Talula
Artöm
Artöm
Or let old vector be deleted and use another
Artöm
Or maybe you need another data structure and not vector
Talula
Structure is not a class and it's not reserved by your program automatically, you can just delete the pointer to mermory location and that is it.
If you're using malloc then use free()
if you're using C++ use delete or free
Artöm
Artöm
And using malloc and free in C++ is not recommended
Artöm
But possible
Talula
Reserved means when you call malloc the program looks for not used memory and instruct the OS that these bytes are blocked by my program.
Artöm
Artöm
They are the same thing in C++
Talula
Structure if used without malloc doesn't matter because you can ignore the point and your structure is dead.
Talula
Class if object is created out of it, then that object doesn't die automatically if you're not in scope and has to be killed and resources freed.
Artöm
Abel
Check out this open source music app 👆
Abel
I feel betrayed 😢
Artöm
class C {
std::string{ "str" };
};
int main () {
C c; //created
} // deleted
Dima
/ban Ding-dong you got a ban, ding! (link download)