What's the best way to declare a pointer to a character array?
Type: Posts; User: catacombs
What's the best way to declare a pointer to a character array?
What does "go deeper" mean? What exactly do you want to do? That will determine your next language.
Yes, but you can still get a core dump of the program.
The compiler won't show the errors. What does the terminal say when you run the program? Have you considered trying to get a core dump?
Is this a class assignment?
Thanks again, Hodor and laserlight. Great explanations. I'll come back if I have other questions.
Thanks, Hodor.
I get what you're saying about not modifying char*. But what if I don't know the string ahead of time and need to modify it?
Would it be better to create a buffer -- char...
Thanks, laserlight, as always. A follow-up question:
What do you mean by string parameter whose contents might be modified? Are you
talking about passing a character array to a function?
...
Hello!
It's been a more than year since I started learning C, and I can certainly say
I'm more comfortable with the language than before.
One thing I've been thinking about recently is when to...
It's a pointer to an array of characters.
Rust aims to be a C/C++ replacement, but it has a long way to go. There are a lot of legacy systems written in C/C++ that would cost too much time and money to be rewritten in Rust.
C/C++ are safe...
Hah. I remember some grumblings about a help troll.
What happened to him?
Salem is right about prototyping functions, OP:
#include <stdio.h>
void my_function(char*);
int main()
Is a .cvs file what the pharmacy uses to print the really, really long receipts? ;)
I didn't notice this thread was about C++ book recommendations. I read it as regular C.
Regardless, the C book I talked about is C Programming: A Modern Approach - Second Edition.
For C++, I'd...
Moden C by King is a great book. I've been going through it since the beginning of the year, and I've learned a lot. There are plenty of exercises and examples available. You can skip most of the...
Please format your code next time.
Surely there must be a way to load the questions from another file, yes?
Is the code legit? If so, where did you get access to a bank management system's codebase?
No problem! I think OP said he or she won't know how many players will be in the final ahead of time. So, he or she will need to calculate that.
If you're addressing this to me, I know how many because I counted the number of rows, each a player, from the input file.
Definitely simpler! I guess my newbie tendencies got the best of me and went a little overboard.
This was an interesting challenge. I spent the morning implementing my own solution. This program can take in a different number of players from a seperate file. I set the initial value for...
Do you have examples of the data file? I'd love to do this on my own and see if I can find a solution.