Sahil
Shubh
From where to learn advance c++ ?
Shubh
Shubh
Or just give me the name I will download it.
Anonymous
Where? Can you pin..
It is just 3 or 4 messages above your message. Scroll up. The Stackoverflow link
Brown
.
Shubh
Thanks
Shubh
Anyone here who had done intermediate to advanced in c++
Anonymous
Anonymous
Im not sure if im in the right group, but how can i make an operating system? What language or a source of software that i need to build my own os?
Vikas
I think all of the operation systems are built using C++.
Vikas
You can use Linux source code and make your own distro.
Jagadeesh
#include<stdio.h>
int main(){
int arr[50];
int n ,ele,loc,i;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&arr[i]);
}
printf("enter the element to insert:");
scanf("%d",&ele);
printf("enter the loc to insert:");
scanf("%d",&loc);
for(i=n-1;i>=loc;i--){
arr[i+1]=arr[i];
}
arr[loc]=ele;
for(i=1;i<=n+1;i++){
printf("%d\n",arr[i]);
}
}
Jagadeesh
Naina
Jagadeesh
okay
Jagadeesh
Sandeep
float** mat2 = new float*[4];
for (int i = 0; i < 4; i++)
mat2[i] = new float[4];
mat2 = {
1, 1, 1, 1,
2, 2, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4
};
Sandeep
What's wrong with this type of assignment
Anonymous
float** mat2 = new float*[4];
for (int i = 0; i < 4; i++)
mat2[i] = new float[4];
mat2 = {
1, 1, 1, 1,
2, 2, 2, 2,
3, 3, 3, 3,
4, 4, 4, 4
};
This is not correct. mat2 is just a pointer to a pointer to a float. It doesn't support assignment using an initializer_list.
And though this is not exactly related to your question, it is just an FYI. Aggregate initialization of arrays can't be used with array of pointers to arrays which are all dynamically allocated. Aggregate initialization of arrays assumes elements to be in sequential order in memory. This is not the case in your example. The C++ standard doesn't have the syntax to support such initializations anyway.
Sandeep
Moseh
Any revision materials for C programming. Am having my exams soon
Naina
Which function should be used to clear the keyboard buffer while taking input in a char array ?? Because as soon as the enter key is pressed while taking input for the size of the char array ..the enter key is misinterpreted for the end of char array ..how do I correct this problem ?
Dr
Dr
I’ll see if i can help
Talula
Paste bin and send the link
𝐄𝐲𝐚𝐝
I created this voting system, (like the one we see in telegram) in C++.
It's done in Visual Studio and system ("CLS") is used, which means that you have to run this code in Windows (Recommend).
So,
Is my code a good one for a person who just started OOB?
Here is the code:
https://pastebin.pl/view/b9a44cce
𝐄𝐲𝐚𝐝
Dumb
memcpy(app, &name[5], strlen(name)-5);
in this case i'm copying the 5th element of name or the first five ones?
Dumb
Or Am I copying from the 5th char?
Tali
I need help, how do I share the code to the program?
Anonymous
I'm trying to do my own implementation of strlcpy function of string.h:
size_t strlcpy (char *restrict dst, const char *restrict src, size_t dstsize). If you make dstsize more than actual size of dst array, the complier throws a warning. I was wondering how would a go about implementing the same mechanism.
SчитаХЭяяоrS
SчитаХЭяяоrS
Tali
there is another way ? my code is very long and i don't find the error
rystik
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int a;
printf("Enter a number");
scanf("%d",&a);
printf("You have entered %d",a);
return EXIT_SUCCESS;
}
rystik
any problems
Tali
D
please how do i Count the number of ‘e’ in a string "excavation extract" and print it out
Tali
who can help me, can write to me in private?
rystik
D
SчитаХЭяяоrS
there is an app called sololearn that has a very large and active amount of users
SчитаХЭяяоrS
install it and ask your questions there
Alberto
Beginner question:
char s[];
In assigning the pointer p to the first element of the array s, shouldn't I write: char p = &s[0] ?
Because if I write: char *p=&s[0]; I am assigning the DATUM corresponding to the pointer p to the address of the first element of the array, not the actual pointer.
rystik
🙁
Anonymous
https://pastebin.com/7BRCcikP
Anonymous
https://pastebin.com/7BRCcikP
hello guys has anyone time to see why my code crashes when i dynamically allocate a struct array xD
i cant write in the strings allocated as it crashes rip
rystik
But the eclipse ide didn't run
rystik
There is a problem in "enter a number"
Dr
Anonymous
Alberto
Beginner question:
char s[];
In assigning the pointer p to the first element of the array s, shouldn't I write: char p = &s[0] ?
Because if I write: char *p=&s[0]; I am assigning the DATUM corresponding to the pointer p to the address of the first element of the array, not the actual pointer.
Dr
Tali
who can help me, can write to me in private?
Anonymous
Anonymous
Dr
Dr Dre
Quite lengthy, but will look into it when I’m free
Anonymous
Hello guys , can you recommend me some advaced books about c programming? Some thing like posix libs , socket programming , create process , data structures and so on
Thanks
Dumb
rystik
In
printf("enter a number");
Миршохид
D
artemetra 🇺🇦
hi, i'm reading one byte from a file, so i use a char for the datatype, however, i need to compare it to integers, rather than actual ascii characters, if i cast it to an int - it would take 4 bytes now, so i'm unsure if it'll work. how do i compare them? because i highly doubt there's a 1 byte int
Dumb
Dumb
try to rebuild your project
Dima
/ban @hpsharkx go fuck yoself
Pradevel (Pratyush)
🤣