Hanz
Anonymous
Bruh please
Anonymous
I mean it
Hanz
wait 40 minutes
Anonymous
Okay sir
Anonymous
Thanks bruh
Anonymous
Chat c;
For (c=0:c<=256;c++)
{
Printf("%c", c);
}
Output ?
Pavel
Anonymous
I know it's output.... I didn't mean that you have to run... It is to check yourself..... And what's problem with you? If you dont want to tell then ok leave it....there are 13731 people in this group
Anonymous
Pavel
Anonymous
Anonymous
It's ok bro..... Well, This is infinite loop......
Pavel
I didn't get...
I mean it's your first message in the chat, you send some code and just one word "Output?".
The first thing I can guess that you are doing some exam or homework and want to know what output of this program would be and too lazy to even describe what you want.
Now after you described more I see that's not the case, my apology for not understanding you correctly.
Pavel
And it's not about you, just there are too many people that actually do that (send their assignments here)
Anonymous
Anonymous
Well, I'll post any question from now onwards.......
Anonymous
Anonymous
Have a great day...
Pavel
Gakume
I have a question:
There is a class which have a const variable called name, now I want to write both copy constructor and assignment operator for this class. What is the right way to handle the const variable? Since it should not be changed.
Gakume
Here is the full code if anyone wants to see. https://gist.github.com/incfex/3497539bbdf29b682087498adc41f20b
Anshul
Gakume
For constructors, I did use initialiser list, but I am not sure about assignment operator one.
Anonymous
Suppose I wanna find if a no. exists in the array using hashmap.
unordered_map<int, int> m;
for (int i = 0; i < n; i++) {
m.insert({ i, arr[i]});
}
I'm getting the answer correct.
Now my doubt:
A key must be unique, but values may be more than one, right? So, the line m.insert({ i, arr[i]}); also works for m.insert({arr[i ], i);, thus the key-value mapping is different. Why's this working?
Pavel
Chat c;
For (c=0:c<=256;c++)
{
Printf("%c", c);
}
Output ?
By the way, here's a more interesting riddle. This modification of your code will either print 128 characters and stop or will end up in infinity loop, depending on compiler and compiler flags.
What is wrong with this code?
#include <stdio.h>
int main()
{
for (char c = 0; c <= 128; c++)
{
printf("%c", c);
}
}
Gakume
Gakume
Pavel
Gakume
Anonymous
Anonymous
Anonymous
I agree
Sam
/get cppbookguide
olli
Pavel
Jason
include Deck -> Deck will be holding 52 cards (cards came from Card class).
include Player
main()
{
Deck deck;
Player user(deck) ;
Player computer(deck);
user.pick_cards(); -> here you show the user 5 random cards and ask if he is ok with them
pick_computer_cards(); -> computer always pick 5 random cards
user.show_cards(); -> reveal his 5 cards
computer.show_cards(); -> reveal his 5 cards
if user.get_points() > computer.get_points() -> calculates points and do the comparison
{
print "user win"
}
else if user.get_points() < computer.get_points()
{
print "computer win"
}
else
{
print "draw"
}
}
Jason
It is not running l need help
Anonymous
This message couldn't be displayed on your device due to copyright infringement.
Anonymous
??
Merit
Wap to.print the armstrong numbers between the numbers entered by user. Program must use a function to check whether given no is armstrong or not.
ㅤ
Hi everyone, I've create a vector pointers to my base class
vector<Base*>test;
(Base is an abstract class)
I used this vector to push back the classes, which inherit from the base class
test.push_back(new InheritedOne());
test.push_back(new InheritedTwo());
Is there a way i can add my abstract base class as well? Or any other different container or way to store my base class and inherited together?
佳辉
cant send picture at here?
佳辉
Students find their own project based on criteria / scope of the project.The scope of the project to be carried out MUST BE using control structures AND Function:
i. At least using MORE THAN TWO (2) Arithmetic Operations AND
ii. Using Selection statement (if -else/switch case) AND
iii. Looping Statement (while/do-while/for) AND
iv. At least using ONE (1) function
佳辉
Any suggestion for the project?😭
Anonymous
Anonymous
Hi
Is there anyone teach low latency c++ programming ..
Talula
佳辉
Talula
佳辉
佳辉
This part?i dont understand what i need to write...
Talula
佳辉
佳辉
What should i write actually?based on code?
Gnostic Trades |
/getcbook
Stay Forward
/getcbook
佳辉
佳辉
Something like this?
Talula
佳辉
Code WHIZ
Code WHIZ
Simple amd easy as well
Rohan
Hii, Can I ask my doubts regarding a program in c language?
I want to make an array which stores the address of each element of another array. But both the arrays should be created dynamically. Here is my code
Rohan
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
int *a;
int ar;
int i,n;
printf("How many");
scanf("%d",&n);
a=(int*)malloc(sizeof(int)*n);
*ar=(int*)malloc(sizeof(int)*n);
printf("Enter %d numbers\n",n);
for(i=0;i<n;i++)
{
scanf("%d",(a+i));
*(ar+i)=(a+i);//storing the address
}
printf("Traversing using pointer variable");
for(i=0;i<n;i++)
{
printf("Address of a[%d] is %d and value is %d\n",i,*(ar+i),(ar+i));
}
printf("\n");
printf("Traversing using original array");
for(i=0;i<n;i++)
{
printf("Address of a[%d] is %d and value is %d\n",i,a+i,*(a+i));
}
return 0;
}
klimi
a=(int*)malloc(sizeof(int)*n);
this looks weird
klimi
*ar=(int*)malloc(sizeof(int)*n); ani you are taking *ar from int... i dont think that is possible
tim
tim
Well, I could work
tim
Because then you would store the memory location for the memory you just allocated somewhere in an int. It is however not guaranteed that this conversion works
tim
Plus: The place where you are writing to is also not allocated, so you would get a segmentation fault there