Forum: C Apr 13th, 2007 |
| Replies: 4 Views: 1,843 link (http://c-faq.com/expr/ieqiplusplus.html) |
Forum: C Oct 9th, 2006 |
| Replies: 1 Views: 3,258 Read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351) |
Forum: C Oct 5th, 2006 |
| Replies: 19 Views: 3,887 It means how many of size_t_Size you want to write.
fwrite(buff, sizeof(int), 4, someFile) means you want to write four ints to file. |
Forum: C Sep 30th, 2006 |
| Replies: 10 Views: 2,291 Use code tags (http://www.daniweb.com/techtalkforums/announcement8-3.html) and don't use void main (read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376)) |
Forum: C Sep 29th, 2006 |
| Replies: 10 Views: 2,291 With which part do you have problem? Formula for conversion or programming issue? For formulas, read this (http://www.google.com/search?hl=en&lr=&q=formula+temperature+conversion&btnG=Search). For... |
Forum: C Sep 27th, 2006 |
| Replies: 34 Views: 11,239 The point is that ch is not NULL. Check the debug printf in my post |
Forum: C Sep 27th, 2006 |
| Replies: 34 Views: 11,239 The seg fault is becouse if you dont have ';' then pch is NULL. So seg fault will happen only if you dont have ';' in the input string. You need to change the logic
#include<stdio.h>
#include... |
Forum: C Sep 26th, 2006 |
| Replies: 34 Views: 11,239 Thats why we insist to post the code or if you cant, then U need to reconstruct the problem in smaler code. The post I posted don't give seg error, if U don't belive me compile and run the code which... |
Forum: C Sep 26th, 2006 |
| Replies: 5 Views: 2,567 You are not calculating the total gallons after first gallon input before while, and after finishing the prog you are substacting from total gallons -1. |
Forum: C Sep 25th, 2006 |
| Replies: 34 Views: 11,239 It means that ch is NULL. Your code have lot of compile errors. j not defined and tr structure not defined.
void function()
{
int i,index,k,m;
char str1[100],retry,str[100],*ptr,*ctr;
... |
Forum: C Sep 22nd, 2006 |
| Replies: 34 Views: 11,239 Run this code
#include <stdio.h>
#include <string.h>
int main()
{
int num, ch;
char str[10];
char * ptr = NULL;
printf("Input some int: "); |
Forum: C Sep 21st, 2006 |
| Replies: 6 Views: 1,378 Hm you need to performulate th question. Whats section? This word is too abstract
EDIT: Sorry after the second post its clearer |
Forum: C Sep 20th, 2006 |
| Replies: 11 Views: 6,763 Don't know is it the best way but you can do like this. Parse the string until the space (' ') and the number until the space convert to int element of array. |
Forum: C Sep 20th, 2006 |
| Replies: 7 Views: 5,382 The problem is that (if I understood the problem corectly) stringLenis 375 and output is 100 chars. Just you need is output[376]instead of output[100], of course if using this string
char... |
Forum: C Sep 18th, 2006 |
| Replies: 3 Views: 1,054 Use code tags. U need to beautify little your post. I don't think that someone will read the whole post it's enormus. First of all don't use scanf("%s", string);. Read this... |
Forum: C Sep 18th, 2006 |
| Replies: 4 Views: 2,061 >The program will accept a non-integer value, but I want it to continue reprompting the user when a non-integer is entered.
You can use fgets and then parse trought the string checking is it number... |
Forum: C Sep 15th, 2006 |
| Replies: 33 Views: 70,445 Tried here (http://www.google.com/search?hl=en&lr=&q=download+free+turbo+C+compiler&btnG=Search)? |
Forum: C Sep 14th, 2006 |
| Replies: 6 Views: 3,574 <gcc simply pass without giving errors or warnings
Well there are warnings. Try to copile like this
gcc var.c -o var -Wall
<When I went thru disassembly, I found nothing useful in it
ofcourse... |
Forum: C Sep 13th, 2006 |
| Replies: 3 Views: 2,906 Put your code inside [ code][/code ] tags. Read post no 7 in this (http://www.daniweb.com/techtalkforums/thread54763.html) thread. |
Forum: C Sep 13th, 2006 |
| Replies: 50 Views: 8,408 <<several intervening off-topic posts were deleted>>
Well the thread is not solved. Read post no 41
>Is it we have to replace it with fgets?
In your case it's better to do it with fgets... |
Forum: C Sep 12th, 2006 |
| Replies: 9 Views: 1,787 Yes your right. I forgott the sizeof(int) and sizeof(int*) is not same on all machines. You have perfect eyes. |
Forum: C Sep 11th, 2006 |
| Replies: 3 Views: 1,029 #include <stdio.h>
#include <stdlib.h>
int func();
int main()
{
short mat[3][3],i,j;
for(i = 0 ; i < 3 ; i++) |
Forum: C Sep 11th, 2006 |
| Replies: 9 Views: 1,787 Read this (http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++) |
Forum: C Sep 11th, 2006 |
| Replies: 9 Views: 1,787 To allocate two dimensional arrays
#include <stdlib.h>
#include <stdio.h>
int main()
{
int ** array, i;
array = calloc(256, sizeof(int));
if (array == NULL)
{ |
Forum: C Sep 6th, 2006 |
| Replies: 3 Views: 1,150 You mean segmentation fault? Accessing memory which is not suposed to access (you probably wonder wtf that means :)). It would be best to post your code so we could help you. More information here... |
Forum: C Sep 5th, 2006 |
| Replies: 12 Views: 3,636 Try to search at google (http://www.google.com/search?hl=en&lr=&q=state+transition+diagram&btnG=Search) |
Forum: C Sep 4th, 2006 |
| Replies: 4 Views: 2,896 Ok you can use those library functions which I mentioned (include string.h). But you shold post your code for more asistance, becouse forum members can't understand clearly what problem you dealing... |
Forum: C Sep 4th, 2006 |
| Replies: 4 Views: 2,896 Don't understand. The user must enter numbers or chars? Both? To copy chars to buffer you can use for example memcopy or better memmove |
Forum: C Sep 1st, 2006 |
| Replies: 3 Views: 1,318 First of all fflush(stdin);won't do the work!
Read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044873249&id=1043284392) and this... |
Forum: C Sep 1st, 2006 |
| Replies: 50 Views: 8,408 Just a small corection. Instead of
fscanf(Contactbook,"%s %s %s %s %s ",contactbook.names, contactbook.birthday, contactbook.hp, contactbook.address, contactbook.occupation);
... |
Forum: C Aug 31st, 2006 |
| Replies: 50 Views: 8,408 First of all delete all fflush(stdin) in your code. Instead of first fflush(stdin) in Add func type
while ((ch = getchar()) != '\n' && ch != EOF);
declare ch as int. Read this... |
Forum: C Aug 31st, 2006 |
| Replies: 50 Views: 8,408 Check this link (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351) |
Forum: C Aug 30th, 2006 |
| Replies: 5 Views: 9,048 > how about std::accumulate?
Don't remember this C statement :) |
Forum: C Aug 28th, 2006 |
| Replies: 15 Views: 4,282 #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
void decToBin(int number, int base);
int numOnes = 0;
int main()
{ |
Forum: C Aug 24th, 2006 |
| Replies: 18 Views: 4,203 I can't belive it. How is this possible :)
for (int x=0; x<strLength; x++)
{
if (0 == (x % 4) && 0 != x)
putchar(' ');
putchar(str[x]);
} |
Forum: C Aug 24th, 2006 |
| Replies: 15 Views: 4,282 This is illegal. What did you want with this line? |
Forum: C Jun 24th, 2006 |
| Replies: 11 Views: 3,884 This is just an idea how can solve your problem
#include "stdio.h"
#include "pthread.h"
pthread_t threadEvent;
unsigned char breakLoop = 0;
void * Exit(void * ptr) |