Forum: C++ May 9th, 2007 |
| Replies: 4 Views: 10,693 First of all add code tags. Find out why void main and gets are bad. There is many posts about them. |
Forum: C Apr 13th, 2007 |
| Replies: 4 Views: 1,850 link (http://c-faq.com/expr/ieqiplusplus.html) |
Forum: C++ Jan 12th, 2007 |
| Replies: 3 Views: 2,251 C++ is a programming language and turbo C++ is a compiler. |
Forum: C Oct 9th, 2006 |
| Replies: 1 Views: 3,261 Read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351) |
Forum: C Oct 5th, 2006 |
| Replies: 19 Views: 3,899 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++ Oct 2nd, 2006 |
| Replies: 16 Views: 10,166 Try to use sleep or usleep. I think that they are not standard functions but U can try. Use these func without including extra headers. The compiler will tell you that they are implicit declared. If... |
Forum: C Sep 30th, 2006 |
| Replies: 10 Views: 2,294 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: 6 Views: 4,683 Change the constructor to
rectangle()
{
length = 1;
width = 1;
} //constructor sets length and width defaults to 1
or |
Forum: C++ Sep 29th, 2006 |
| Replies: 6 Views: 4,683 Hm never seen that (probably becouse I'm not c++ programmer). But the book never lies. Make a test just leave the construtor and what will the copiler tell U |
Forum: C Sep 29th, 2006 |
| Replies: 10 Views: 2,294 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: 6 Views: 2,822 |
Forum: C Sep 27th, 2006 |
| Replies: 34 Views: 11,255 The point is that ch is not NULL. Check the debug printf in my post |
Forum: C Sep 27th, 2006 |
| Replies: 34 Views: 11,255 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: 5 Views: 5,665 If you want help you need to post the whole code. Read this (http://www.daniweb.com/techtalkforums/announcement8-3.html) |
Forum: C Sep 26th, 2006 |
| Replies: 34 Views: 11,255 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,571 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: 6 Views: 1,846 Did you tried cin.ignore after cin.get(ifname, 150); ? |
Forum: C Sep 25th, 2006 |
| Replies: 34 Views: 11,255 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 24th, 2006 |
| Replies: 5 Views: 4,255 The point is that you need to post some code. If you find some C++ program then try to convert it to C. If you have problems then post it. |
Forum: C++ Sep 22nd, 2006 |
| Replies: 3 Views: 1,284 First of all your code doesn't compile without errors. Fix the errors. |
Forum: C Sep 22nd, 2006 |
| Replies: 34 Views: 11,255 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,381 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: 14 Views: 2,831 Instead of double use long long. |
Forum: C Sep 20th, 2006 |
| Replies: 11 Views: 6,769 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: 5 Views: 1,444 Why don't you use the compiler to check the code. Do you have question?
check.cpp: In function `bool checker(int)':
check.cpp:19: warning: control reaches end of non-void function
Thats after my... |
Forum: C++ Sep 20th, 2006 |
| Replies: 4 Views: 1,126 You should go throught pointer tutorial.
OK *(ptarray[i]) is dereferenced pointer of ptarray[i]. Here is the deal.
ptarray[0] value is address of ar. When you dereference it you will have the... |
Forum: C++ Sep 20th, 2006 |
| Replies: 5 Views: 2,173 Hm well on this forum you can get diffrent answers. The best way probably is to consult your teacher. |
Forum: C Sep 20th, 2006 |
| Replies: 7 Views: 5,393 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,055 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,074 >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 18th, 2006 |
| Replies: 5 Views: 2,907 >then I might have to suffer a non-standardized design, which isn't a big deal
then use getch |
Forum: C Sep 15th, 2006 |
| Replies: 33 Views: 70,586 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,583 <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,912 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,413 <<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,801 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,801 Read this (http://en.wikipedia.org/wiki/Compatibility_of_C_and_C++) |
Forum: C Sep 11th, 2006 |
| Replies: 9 Views: 1,801 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 8th, 2006 |
| Replies: 6 Views: 2,466 |