Anonymous
https://pastebin.com/GvTZ4y3B Please help to make import of sdk functions of game to my functions file
Don't use relative paths with .. in your includes. Instead mark the directory in which the header resides as an include directory. How you do this depends on the compiler. For ex - With g++, you can do it with -I flag.
/
Help i have a problem
/
I have a Main.cpp file that includes an header
/
wait
/
the main includes #include <cstdint>
后藤
how can i compile cpp on ipad?
/
and also #include "RAM.h"
/
but in ram.h i have not the c int types included
/
if i try to use uint8_t it gives an error
/
i think gcc
/
wait maybe g++
后藤
if there's any namespace?
/
i dont know
/
why
/
10.3.0
/
identifier "uint8_t" is undefined
artemetra 🇺🇦
/
i have included the int types header in main and the included the ram
/
include them, then
again also in the header
/
i didnt want to include it every time
/
wait
后藤
what your gdb reports?
/
what your gdb reports?
i just need to know how to include it only one time
后藤
em
后藤
include one head file in the other
后藤
and only one head file is needed
Anonymous
I CANNOT UNDERSTAND HOW TO GET REAL PATH, CAN GIVE ANY DIRECTIONS ABOUT IT
For ex if you have two directories headers and src and you have a file fcn.h in headers/ and main.cpp in src. And suppose your main.cpp uses #include "fcn.h" Now for this to compile, you have to tell the compiler that while compiling main.cpp, it should know that headers should be searched for in the headers directory. This can be done like this: g++ -I../headers -c main.cpp -o main.o If you are using a build tool like CMake, this can be achieved using target_include_directories. You can look up how to do this for the compiler you are using.
Anonymous
but in ram.h i have not the c int types included
If ram.h uses types defined in cstdint.h, then ram.h should also include cstdint.h
/
but i have another problem
/
i am using visual studio code but every time i try to run the compiler it is runned in debug mode
/
i think the problem is the launch.json file
/
{ "version": "0.2.0", "configurations": [ { "name": "Start", "type": "cppvsdbg", "request": "attach", } ] }
/
how i make it run and not only attach
Unknown man
Can someone tell me if i entered a number like 15 how will store in bytes and in more depth how it is store in bites
Dm
Can someone tell me if i entered a number like 15 how will store in bytes and in more depth how it is store in bites
if int it usually will take 4 bytes: 0b0000 0000 0000 0000 0000 0000 0000 1111. 0x0000000F
▪️fateme👷🏻‍♀️
#include<stdio.h> int comperra(int a,int b) { if(a>b) return a>b; else return a<b; //printf("%d",b>a); } int main() { int a=15,b=20; int c=comperra(a,b); printf("%d",c); } Why this code has 1 as output???
Ольга
Hello I need help with this code. I don't understand why this error appears. Any advice on how to fix this would be appreciated. Sorry to take up your time https://onlinegdb.com/Dne-okm4Y
Aquatica
What are you trying to do? Return which one is the biggest?
/
help i have a question
/
what does it mean when there is the | symbol between function parameters
/
like when you initialize the fstream and you do ios::beg | ios::
/
what do youmean
artemetra 🇺🇦
| is a bitwise OR
/
i know
/
but what it does
/
can you make the example
/
like a example bitwise or
/
it is like the flag 1 is 1000000 and the flag 2 is 0100000
/
the result is 1100000
/
yes very good
Ольга
Hello again. Maybe someone knows why in this I can enter only one value? And not 4, as required. I will be grateful for your help https://onlinegdb.com/dEq5mi24k
the best for everyone
#include <stdio.h> #include <math.h> int isPrime(int k){ int i; for(i = 2; i <= sqrt(k); ++i){ if (k % i == 0){ return 0; } } return 1; } int sum_prime(int a , int b) { int count=0 , sum=0 ; for (int count = a ; sum<= b; ++count) { if(isPrime(count)){ sum+=count; } return sum; } } int main(){ int number; int b ; printf("Enter a prime number "); scanf("%d ",&number); printf("the prime number is %d ", sum_prime(number,b)); }
the best for everyone
what is the error in this
mito
what is the error in this
you tell us the error. Or is there any unexpected/undesired behaviour ?
/
help when i have a bit field can i set the bit value to 1 using bit = 1
Ольга
Hello again. Maybe someone knows why in this I can enter only one value? And not 4, as required. I will be grateful for your help https://onlinegdb.com/dEq5mi24k
If someone don't want to open the file code my program is there #include<stdio.h> struct pair { int first; int second; }tata; void print_struct(struct pair *ptr); void input(){ struct pair *tata; int n; n=2; for(int i=0; i<n; i++){ printf("\nEnter the seating capacity : "); scanf("%d",&(tata+i)->first); printf("\nEnter the fuel type : "); scanf("%d",&(tata+i)->second); } print_struct(tata); } int main() { input(); return 0; } void print_struct(struct pair *ptr) { for(int i=0; i<2; i++){ printf("\n---Details---\n"); printf("First element: %d\n", ptr->first); printf("Second element: %d\n", ptr->second); printf("\n"); } }
Anonymous
{ "version": "0.2.0", "configurations": [ { "name": "Start", "type": "cppvsdbg", "request": "attach", } ] }
Do you mean you want to build in release mode? Even in debug mode, if all that you want to do is run the program, it will still work as long as you don't set any breakpoints. So specify clearly what is it that you want.
Ольга
Someone in this group can help with the labs. works? of course not for free, I just can't write it in any way
▪️fateme👷🏻‍♀️
#include<stdio.h> float add(int,int); float divide(int,int); int main() { int a,b; float(*fptr_arr[2])(int,int); fptr_arr[0]=add; fptr_arr[1]=divide; printf("Enter a and b:\n"); scanf("%d %d",&a,&b); float result=fptr_arr[0](a,b); printf("%f",result); result=fptr_arr[1](a,b); printf("%f",result); } Why this code has this error? [ERROR] I'd returned 1 exit statuse
Go D.
Anyone use vs code for c programming???
Anonymous
yes
Go D.
yes
I'm a beginner and facing a few problems. I cannot work as the tutorial
Anupam2.7
typeid(var).name() results into c so which datatype is this?