Also find out the difference between using static variable vs a global one.
Type: Posts; User: swgh
Also find out the difference between using static variable vs a global one.
int main()
Is another one too - the difference is entirely compiler specific. For instance the LCC compiler will give a
warning if the char* args version us used without explicitly giving the...
What could be wrong here?
OMG
Two great community members - will be sadly missed. I remember them both fondly. Dave had an Avatar of a cat and I think he might of been a mod at one point. Adak was quite a seasoned poster...
Main returns an integer.
It's usually best to explicitly assign variables a value before you use them to avoid any garbage values being calculated.
Try not to use system call functions to pause the...
I used to have the "Dragon" probably one of the oldest computers I owned back then. I've been through a fair few, here's my list:
Binatone
Dragon
Spectrum Z86
C64
Amiga 500
Amiga 500+
Amga...
Not sure what you mean by "spoiling performance"? Are you getting overflows or negative values, or is the random generation not 'random' enough?
Hey Guys!
I installed Microsoft Visual Studio 2017 RC and it's the first RC version of VS I have ever had - I know a release candidate is not the "final" version of the software, but I am curious...
1. Main always returns int
2. Your FILE pointer should be assigned NULL before it's used if not assigned at declaration
3. It's also a good idea to assign the struct member "number" something also...
Depends what the tattoo is of. Well, joking around it could be a nude woman for example that most people get on board with :D
If you feel that could help people look for the possible error then yes that could be an idea, but it's your personal work and it's up to you to feel comfortable with what you decide or decide not to...
I'll give you some very general tips.
Your going to need two loops, one outer loop and one inner loop. Both continuation conditions are going to have to either increment to ten or decrement to...
There are generally two reasons for this type of error.
1. The function has not been defined (generally a prototype) before it's used.
2. The other and more probable reason is the function name...
Not that this is entirely related, but it's always a good idea to check the return value of scanf when it's used.
Have you "included" the header file holding the function prototype in the same files as main.c and file.c?
A lot of people on here may have accounts on other forums too. I know for a fact Salem has/did have an account on Code Project.
Sorry Salem ;)
Also - there are a lot of newbie coders joining...
Do not ever use goto. Use a loop instead or some other conditional statement to return to that point of the code.
Do not use getch() it's non-standard and not globally supported on all platforms....
True - colleges and some 'older' books do still enforce people learning C++ to learn C style arrays before Vectors. However vectors are part of the STL and perhaps authors of those books or lecturers...
Thank you algorism. I really appreciate your input on the subject :).
Oddly, I generally got the unused warning if for example if I declared but did not use a variable as you stated, just never...
Thanks Salem.
I swapped the 'c' and 'v' around and will keep to that format from now on. I still do not understand why I am getting "unused" warnings about the parameters of the main function -...
Hey guys!
I recently updated code::blocks to the new version for my home laptop and I always compile using the LCC compiler.
Before the upgrade - this:
//....
int main(int argv, char*...
Ada's Extra Advice: :D
Also pick a language that you feel comfortable with. Don't go by the Tiobe Index etc - if your brand new and C/C++ scares you (it shouldn't really as both are good first...
The C standard guarantees that any object pointer type can be converted to void* and back again without loss of information (meaning that the re-converted pointer will compare equal to the original...
>while(!feof(file)) {
Does not read the entire file correctly. Use
while (fgets(<string name> sizeof(<string>) fptr) != NULL)
Looks pretty good. Clean and concise code with good indentation and current standard function calls. One very slight thing, the way you declare your functions seem a little strange:
void...