Depending on your needs, the right tool for the job may be shifting to a managed language such as C# or VB.NET. Both of these language wrap the COM interface nicely and allow for easier db access....
Type: Posts; User: AndrewHunter
Depending on your needs, the right tool for the job may be shifting to a managed language such as C# or VB.NET. Both of these language wrap the COM interface nicely and allow for easier db access....
Why don't look at this pointer tutorial .
That depends on what IDE you are using and if the IDE in question is capable of working with template files.
You need to look at your entry loop:
for (i=0; i < n; i++) {
printf ("Enter a value: ");
scanf ("%d", &list[i]);
}
All this does is put values into the array. The layout of...
Do you know what you are doing at all or are you just randomly cutting and pasting code from various places? These questions are ridiculous between this post and your other one.
What is the point...
Do you know how to solve this problem on paper? Why don't you right out the steps for a linear search and list them. The logic above is not what you want.
So why do you think that is? What happens in your loop if the number is not found? Right now your for loop basically says:
for(all numbers in array)
{
if( number is found)
{
...
Take a look at how fgets() works. You have 16 characters to read in + the newline + the null terminating character for a grand total of 16 + 1 + 1 = 18. Just because you don't see the characters...
Each iteration prints something, either found or not found. That is what Salem is referring to. Compare this function with your search binary function and note where the difference is.
Take a look at the how do I make my console window stop disappearing FAQ and also look at how to define main.
Your functions that you are calling are taking an argument, hence their prototypes (declarations) that I laid out in the skeleton example. However, you are not using the arguments that are supplied...
Try this: how to define main
I was editing my last post when you responded. Take a look at the tutorials I linked to and the skeleton layout I provided. It should put you on the right track.
I did, read the tutorials on functions. That will give you a good start. As will the tutorial on using if statements in C. Also you edited your post to make your original request seem more earnest.
...
"How you need to do this" is to figure out how to perform this on paper. Take a look at the development process. Additionally, once you have figured out how to do it without a computer, then you need...
I suggest you look at what functions are. You have no functions in your program at all. Even though your assignment says to make a sumFor and sumWhile function you declared integers with those names:...
You mean this broken hybridization of C++/C code into just C? How about you tell us what you are trying to do and then make an attempt. Looking for answers to homework problems on the internet and...
Yep, take a look at this good pointer tutorial and linked list tutorial . You are on the right track. Also, you should define main the correct way . Additionally, your printList function does not...
In order to change the values actually at temp, just like for root, you need a pointer to a pointer. Not just a pointer.
Yes, how about you read the link I posted about loops and then implement one. Do not call main recursively, this is a very bad programming practice.
Here is a novel idea, why don't you read about loops in C and then tell us?
What you want to look at is the fgets() / sscanf() combination to read a line at a time and parse the line into your array.
Also, take a look at the proper way to define main and why global variables are bad .
Value is not initialized when you check it's value with line 13. You never gave it a value when you declared it (look at line 7). You are relying on undefined behavior. This code is bound to break....
Based on your initial question, no you are not familiar with C++. Go with VB.NET if you need to make a "program from scratch". If not use MATLAB. This will save you a lot of frustration in the long...