/
i dont know
/
because i never tried
Anonymous
For example GCC for x86 carries some x86-specific headers specifying those types, GCC for ARM same thing ...
Anonymous
Hi
/
For example GCC for x86 carries some x86-specific headers specifying those types, GCC for ARM same thing ...
but if there is a computer with the char size 2 byte how do you make a type with size 1 byte if char is the smaller type in c
Anonymous
Does anyone group programmers For node js or js
Anonymous
and how do you write a type that is always 8 bit in every computer
If some *rare* architecture has char to be 2 bytes in size either one of these situations may exist: * uint8_t is undefined * uint8_t is actually sized 2 bytes, this can be done for cross compilation compatability maybe But I don't actually know well because I have never dealt directly with this situation
Anonymous
I am looking for links to other programming groups
/
but there is a vm written in c with an an instruction to write 4 bits in a register
Anonymous
Anonymous
If you're interested in manipulating bits have a look at bitwise operation, struct bitfield
/
is it with bitfields
Anonymous
Base size is always 1 byte, you may make only meaningful usage of the lower 4 bits, the remaining ones' state is left unknown and irrelevant to the state of the program
/
yes
/
i think that the vm to do that uses bitfields
Anonymous
You leave the work of manipulating bits to the compile's implementation
Anonymous
and in c do volatile register place a value always in a register
If compiler strictly follows the standard, yes, it will find a way to do that
Anonymous
But you may check using a disassembler
/
But you may check using a disassembler
i know that volatile makes the compiler ignore the optimizations
Anonymous
I think it may even depend on the optimization level, volatile should be used only if you are sure that you can really do better than compiler
Anonymous
Also note that both register and volatile are just hints, that are most likely ignored on aggressive optimization levels
Ludovic 'Archivist'
but they told me to use uint8_t instead of char because char may change between different computers
uint8_t will behave as if it had 8 bits. char will be exactly one byte which can be 7, 8, 12, 24, 32 or any other exotic number of bits.
Ludovic 'Archivist'
the "least" int types will have at least the specified number of bits
Rachit
Hi anyone who knows file handling with fscanf need help to create a if statement to check first char and set up fscanf according to the file format.
pavel
Expected
ʙoᴍо͠ʏ
anyone can help
ʙoᴍо͠ʏ
#include <iostream> #include <iomaip> // untuk manipulator setw() using namespace std; main() { int jumbar1= 150; int jumbar1=23; int jumbar1=1401; cout << "barang1 = " << setw(4) << jumbar1 << endl; cout << "barang2 = " << setw(4) << jumbar2 << endl; cout << "barang3 = " << setw(4) << jumbar3 << endl;
ʙoᴍо͠ʏ
okeyy thanks
DaviChan
Https is not that easy to implement without using OpenSSL or another crypto library to be honest. I would by no means recommend that to a beginner
DaviChan
Projects for beginners in c++?
I love game projects. You can make them as simple or as advanced as you want. And you can find good use for any feature you might be learning at the moment
DaviChan
You can start with tictactoe and work your way up to maybe a raycaster fps or even a full 3d game when you know most things and can manage to learn about vulcan or opengl also
DaviChan
Textadventures are pretty fun also if you have a good story tell
DaviChan
Pseudocode can be any style. It is not strictly defined to my knowledge, so if C++ is your style of pseudocode 🤷🏻‍♂️
DaviChan
Also can we establish to share larger code snippets through github or something?
DaviChan
hard to read here
모하마드
Yes
int n = 58; int total = 0; while (n != 0) { total += n % 10; n = n / 10; } printf("%d",count);
˚ ༘ ೀ⋆。˚
Hi guys
˚ ༘ ೀ⋆。˚
Input two numbers (k and c) and calculate the value of y for x = 0.1, 1, 5 where y = kx + c
klimi
With what?
Rachit
With what?
Hi Can you help me to create a function using fscanf to load data from file I’m confused alot tried but not able to create it.
后藤
https://hastebin.com/ikesupukux.cpp
后藤
what's wrong with it?
后藤
why it report with an error occurred in a official head file?
后藤
In file included from /usr/local/include/ceres/ceres.h:65, from /home/arconan/workspace/SELFDOSLAM/test.cpp:3: /usr/local/include/ceres/product_manifold.h:315:59: error: expected constructor, destructor, or type conversion before ‘;’ token 315 | -> ProductManifold<Manifold0, Manifold1, Manifolds...>;
后藤
gdb's report
▪️fateme👷🏻‍♀️
#include<stdio.h> #include<stdbool.h> struct node { int data; struct node* next; }; bool searchNode(struct node** head_ref,int key) { struct node* current=*head_ref; while(current!=NULL) { if(current->data==key) return true; current=current->next; } return false; } int main() { struct node* node1=(struct node*)malloc(sizeof(struct node)); struct node* node2=(struct node*)malloc(sizeof(struct node)); struct node* node3=(struct node*)malloc(sizeof(struct node)); node1->data=100; node2->data=200; node3->data=300; node1->next=node2; node2->next=node3; node3->next=NULL; struct node* head=node1; searchNode(&head,node3); } This is my code it has no output, Why? Is there anyone to help me with this code?
▪️fateme👷🏻‍♀️
I mean... where do you output something? Or am I just blind?
Id forgotten to put printf, but after placing it, my code gave the output
Anonymous
https://hastebin.com/ikesupukux.cpp
The error you mentioned has got nothing to do with the file you have shown. How do you expect us to help with that?
Anonymous
Also can we establish to share larger code snippets through github or something?
It is one of the rules here and is mentioned clearly in the pinned post. Just that people don't bother following that which is why their posts disappear.
后藤
The error you mentioned has got nothing to do with the file you have shown. How do you expect us to help with that?
i want link gcc to libcuda.so on WSL2 but gcc can not find the file /usr/lib/libcuda.so in the/usr/lib though it's actually there
Anonymous
i want link gcc to libcuda.so on WSL2 but gcc can not find the file /usr/lib/libcuda.so in the/usr/lib though it's actually there
What is the output of ldd <your app name> for libcuda.so? Does it say not found? If you know where libcuda.so is check the environmental variable LD_LIBRARY_PATH to see if that directory is present. If not add it there.
后藤
Oh you mean the linking itself is failing. Try passing -L/usr/lib -lcuda to gcc
i tried it but not work the compiler said undefined reference to `__cudaPushCallConfiguration'
后藤
when i use "-i/usr/lib/libcuda.so" compiler says that /usr/bin/ld: can not find -l/usr/lib/libcuda.so
touhou
when i use "-i/usr/lib/libcuda.so" compiler says that /usr/bin/ld: can not find -l/usr/lib/libcuda.so
I also have that issue. I didn't bother much because I don't use my nvidia card on wsl2. Maybe try looking here. https://docs.nvidia.com/cuda/wsl-user-guide/index.html
▪️fateme👷🏻‍♀️
pavel
Devcpp
why don't you use debugger
▪️fateme👷🏻‍♀️
why don't you use debugger
I don't know how Now there's no problem with the code
touhou
Devcpp
Never heard before 🤔
klimi
int ccyIdx(name) you haven't written the type of name
Anonymous
int ccyIdx(name) you haven't written the type of name
I thought I did that when I typed Char *
Anonymous
Never mind, I think I found the issue (Placement). Thank you so much @K11M1
Void
#include <Stdio.h> int main() { char x; while((x=getchar()!='\n')) if((x>='a'&& x<='z')(x>='A' && x<='Z')) { x=x+4; if((x>'z'&& x<='z'+4)(x>'Z'&&x<='Z'+4)) x=x-26; } printf("%c",x); return 0; }
Void
Guys can you check my code