Start with the pointer name and read backwards:
Const int* my_pointer etc...
my_pointer is a pointer (the *) to an int that is const.
Int * const my_pointer etc...
my_pointer.is a const pointer to an int that is not const.
User Profile
Collapse
-
I am changing the subject to the size of your compiled programs.
Only the functions you call are in your object program.
So if you use a library (.lib) that has 12,000 functions and is 2GB in size , your object program will contain only the bytes for the functions you call.
The linkers job is to copy the functions you call from the library to your object program. Then it links your call to the copy....Leave a comment:
-
A namespace is not a file. It is nomenclature to prevent duplicate function and variable names when you import someone else's code into your code. Or when your code is used by someone else.
Which cout is this:
cout << var;
The sytem cout ?
A cout overload you wrote ?
A cout you got from a vendor ?
The using directive permits ambiguity. Bad news.
Whereas:...Leave a comment:
-
weaknessforcats replied to C++ Return 2 values from function or return multiple values from functionin CFunctions in C++ need to return two things: data and status. The return value is for status, like did the function error out. Data is reurned through an output argument which in C++ is a struct/class reference.Leave a comment:
-
You are not supposed to use the STL as a production library. The STL contains only basic stuff to get you started. It's for students learning C or C++. Many places don't use the STL at all and instead have purhased (or written) their own library.
Look at cell formatting in Microsoft EXCEL and you will see what I mean. Date handling is its own library.Leave a comment:
-
Not quite correct.
When you use:
long f;
Int a;
....etc...
f = fact(a );
The compiler must already seen the code for the function. Otherwise the compiler can't know if you are using the function correctly.
Therefore, you put the function code in your file outside of main(). Unfortunately, if you need this function in another implementation file you must make...Leave a comment:
-
Your function prototype says the fact function has no arguments. The prototype should be the same as the first line of the function:
long fact(int);Leave a comment:
-
-
-
I know what a thread context is but why do you need to count them?
The thread context is the info you need to unfreeze a frozen thread.Leave a comment:
-
Have you stepped through this code using your debugger?
If not, this is an excellent time to learn how to use it, Debugging code is just as important as being able to write it.
Just run the code using the debugger and step through it. You will see the values of all of your variables as you go.Leave a comment:
-
Not possible to do in C or C++. There are really only 1d arrays available.
To find out why please read: https://bytes.com/topic/c/insights/7...rrays-revealed
Then post again if you still have questions.Leave a comment:
-
First thing is to remove data entry from the push() function. You call push using the data. It's not the job of push() to come up with the data.
You also need to supply the address of the stack variable you are going to se to push the data
etc for the other functions.Code:int push(stack* node, int data);
Also missing is the list itself. The code just uses node values
...Leave a comment:
-
This is usually done with two stacks. One for the values and one for the operation.
Let's assume two stacks: Value and Operation.
So 3 + 4 + 5 is parsed to
3 push to Value
+ push to operation
4 push to value
+ push to operation
5 push to value.
So the stacks look like
Value
5
4
3
...Leave a comment:
-
weaknessforcats replied to Create a enum to choose what operation need to be perfomed like (Display class informin CThe first thing I see is that your enum value names are the same as your function names. The compiler now doesn't know what to do, so you get an error.
There may be other errors but fix this one first. All names in the code must be unique.Leave a comment:
-
weaknessforcats replied to <command-line>:0:21: warning: ISO C99 requires whitespace after the macro name <commain CI can't help you here. Your code compiles and links no warnings no errors using Visual Studio 2013.Leave a comment:
-
I'm not sure what you are trying to do. But you never read the .csv file. All you do is close it.
The values in the variables are the ones put in by the program and they never change. Those are the values you display.Leave a comment:
-
-
Yes, of course. That's not that C has special features but that it's easier to write in C than assembly code.
A window is just a graphic display no different from any the display.
Try to find a book on overview of graphic programming.Leave a comment:
-
weaknessforcats replied to Facing an error like... EXPECTATION 13:generalprotection fault at 08C7:210E error codin CThe code you posted won't compile at all. There are missing braces and other syntax errors. Please fix those errors and repost.Leave a comment:
No activity results to display
Show More
Leave a comment: