User Profile
Collapse
-
Thank you. I got it!!!! -
-
How to creat a c project file?
Im just about to write a c programe using multiple files. such as (func.h tools.c and main.c). my question is how do i have to creat a project file?
I am using Microsoft Visual C++ 6 to write and compile my codes...... -
Need ASAP help with a function (program)!!!
I wrote this code, but I'm not able to test it because im getting 3 errors. So I'm not sure that this code will work properly or not!!!
the code in
[CODE=c]
#include <stdio.h>
#include <stdlib.h>
int rnd(char s1[],char s2[],char c[]);
int GetSt(char s1[],char s2[],char c[]);
void SearchAndPrint (char s1[], char s2[], char c[], int length);
int main ()
{... -
My assign was to write a code to do the simple aritmathics.( +, - , / , % , * )
using putchar and getchar.
I wrote my code, but im completely stuck on error checking.
My i/p should be like ^^num^^ oper. sign^^num^^ enter.
like
12 +13 Enter
the error check should be about>>>>
----- 1 2+ 12 no space(s) between an operand
-----No negative operands
-----No extra aritmathic...Leave a comment:
-
yah but in my assign i cant use anything but getchar and putchar!!!...Leave a comment:
-
tanx yeah that was the problem......ta nx very much!!!it was an accident!!!...Leave a comment:
-
I wrote this function to seperate an int number , but it doest work right. it adds an extra 0 in front of every number....can anybody help me pls to find the problem...
my function is
[CODE=C]
void ConvertBack(int number)
{
int b,d,e;
int digit=10;
b=number;
while(1<=(b/10))
{
digit=digit*10;
b=b/10;
}
d=number;...Leave a comment:
-
Ya, it would have been so much easier if i could use arrays, string,or itoa().But unfortunetly im not allowed to use even printf !!!! Only getchar and putchar.Leave a comment:
-
Converting an int into seperated int in C
I just want to convert an int number such as 5267 or 1000000 into seperated integeres.
like for number 5267 it be 5 2 6 7 , so i can print them with putchar(). I know, but i have to use only putchat and getchar in my code. ( no printf or scanf).
I had some thoughts about it but the only thing that i came up is this code which prints the number backward: PLS helpPLS:::::
[CODE=c]
int num=5267 /*for example*/
int... -
Problrm with punc in C
I am writing a very simple program which suppose to get a text froma file and then by ignoring all the spaces and punctuation, copy them to another file , 1 word per line.
my problem is i cant get my program to ignore the punctuations.
my code is::
[CODE=c]
#include<stdio. h>
int main(void)
{
int charac;
int count=0;
while((charac=g etchar()) !=EOF)
{... -
So i will get the int numbers in a string.....chec k to see if they are char or nor then convert them into int ...right????!!!...Leave a comment:
-
i can do that. But there is a problrm.
what if a side of triangle be greater than 9. for example 123, 321, 32. Then what?Leave a comment:
-
I just suppose to get 3 int numbers as 3 sides of a triangle. So I cant allow the user to enter any char or decimals. So is the ASCII valuse a good choice in a while loop or not ( in error checking)?...Leave a comment:
-
Error check in C when a char has been entered intead of an int?
How can i check and creat a loop for the error in which a char has been entered by user insted of an int input!!!!??
Im new to C, so please keep it simple!!!!!!Tan x -
ok i will try that
anyone knows whats wrong with this func
[CODE=cpp]
void copy(char array[],char copyarray[])
{
strcpy(copyarra y,array);
int i=0;
char c;
while (copyarray[i])
{
c=copyarray[i];
putchar (toupper(c));
i++;
}
}
[/CODE]
it suppose to get the array and make all of its contents to upper charachters!!!!...Leave a comment:
-
ok i got it i revised the code to
[CODE=cpp]
#include<iostre am>
#include<cstrin g>
#include<fstrea m>
void reverseit(char array[]);
using namespace std;
int main()
{
ifstream infile;
infile.open("in put.txt");
outfile.open("o utput.txt");
char name[60];
if(infile.fail( ))
cout<<"FAILED";...Leave a comment:
-
-
Problrm in invesing a char array
i have this code which suppose to get a n input from the file and store it in a char array then i have to inverse it.....
rhis code isnt complete but im getting a wiered error
i see the error when the c++ starts linking not in the compilation procces.
my code is
[CODE=cpp]
#include<iostre am>
#include<cstrin g>
#include<fstrea m>
int reverse(char* str);
using namespace... -
what are u saying?
i got it
i just changed the function type from int to float that was the problem!!!!!
and i got 3.5 not 3...Leave a comment:
No activity results to display
Show More
Leave a comment: