I've got this string:
char * string = "2+2";
I want to get an integer value = 4 from this. How would I go about doing this.
Thanks
Type: Posts; User: popnfresh12321
I've got this string:
char * string = "2+2";
I want to get an integer value = 4 from this. How would I go about doing this.
Thanks
Then I do not understand what is wrong with this:
void pickDoubleMu(teams * sPtr, matchups * head)
{
int i = 0;
char *outputText = "output.txt";
FILE *output =...
Will that keep the update of count?
I have a function that will look something like this:
void function(node* root, int num)
{
int i = 0;
while(i < 10)
{
I ran this on two compilers. One gave me a seg fault, the other runs it fine.
void parse(char *line)
{
char temp;
int i;
int j;
int k, l;
int length = 0;
Now the strcpy portion causes a segfault. Any ideas?
char *titles[10];
int main(void)
{
int i;
char *temp;
for(i = 0; i < 10; i++)
{
printf("Enter Team Name %d: ", i + 1);
The commented out portion in updateCount and checkCount are how I had it with the struct.
What I'm trying to do is create a schedule generator for a fantasy football league. The key things that need to happen are:
-- that all 10 teams have to play every other team in the league once....
New Problem:
After fixing the function above so it's completely functional, I have another problem.
I need to use this function several times to generate different random results. However, it...
Ah. Thanks. My solution was that whenever there was a duplicate I would set j = i so the loop would end. Thanks for all the help. It works now
Ah. that is probably the problem. Any ideas on an easy fix?
Well I'm creating a schedule generator and the number values in the teams array represent teams. And I want to make sure no two teams play twice in the same week. I also wanted the weekly matchups...
Perhaps some helpful information. I changed
while(weeklyUsed[i] == weeklyUsed[i + 1] || res == 0);
to
while(weeklyUsed[i] == weeklyUsed[i + 1] || res != 0);
and it gave me an infinite...
My last three outputs were:
21 27 27 25 21 26 23 28 25 23
24 23 23 25 22 30 25 22 26 28
30 25 22 23 22 29 29 25 25 21
The problem comes when I'm checking all the previous with the current...
'i' will never be 9 since I increment by 2 and it runs while i < 10.
I have the following global array:
int teams[10]= {21, 22, 23, 24, 25, 26, 27, 28, 29, 30};
I want to randomly take all of these values and put them into a separate array. Whenever I run...
I'm trying to create a schedule generator.
I have global variables of
char *team1 = "random name";
char *team2 = "someone else";
What I want to do is make a different string that will be
wow. that would've made things a lot easier
I got a new compiler that I figured out. But it always saves every compiled program under the same name
C and I'm using a school server that has gcc.
I have windows
Any recommendations on which compiler I should use? The one I'm using does not to that. It only creates a temporary executable
I have a .c file completely done. Is there a way to make it an executable file so I can just click on it and the program will just run, without going through weird compilers?
So I can give it to...
Nvm. Figured it out. All I had to do was put check = 0; into the do while loop
I assume the infinite loop problem is with the do while loop. But can't find it