Forum: Getting Started and Choosing a Distro 10 Hours Ago |
| Replies: 3 Views: 64 Tried installing it and...Well lets put it this way, if I wasn't so entrenched in Mandriva I would have switched. |
Forum: C 10 Hours Ago |
| Replies: 6 Views: 98 I'm sure GCC will survive...dings and all |
Forum: C 12 Hours Ago |
| Replies: 6 Views: 98 I did use -ansi -Wall
When I tried -ansi -Wall -pedantic it generated a warning but still compiled and ran without incident.. |
Forum: C 12 Hours Ago |
| Replies: 6 Views: 98 I tried compiling this with the GCC compiler and its works...so I tried compiling with the -S switch(Stop after the stage of compilation proper; do not assemble) and found it create a function... |
Forum: C 1 Day Ago |
| Replies: 2 Views: 109 Try adding this to your if statement:
if(str[i] == 'a')
{
a++;
}
else if(str[i] == 'b')
{
b++; |
Forum: C 1 Day Ago |
| Replies: 7 Views: 223 That would be a debugger your talking about...If you expect your IDE to come fully featured then it won't be lightweight....Can VIM use a debugger? I really don't know because I never tried...
I... |
Forum: C 1 Day Ago |
| Replies: 7 Views: 223 If you want simple and complex then try VIM... |
Forum: C 2 Days Ago |
| Replies: 2 Views: 133 No the code looks fine..If you want to optimizes try experimenting with the compiler's optimizing settings...
Also you may want to look up VLA or 'variable length arrays' |
Forum: C 3 Days Ago |
| Replies: 14 Views: 539 Its undeniable, the point you make. |
Forum: C 3 Days Ago |
| Replies: 4 Views: 197 Then why would you put it in your program?
#
const char *str = &part1; //LINE 28
You have const char *str and your assigning the address of struct parts to it without a cast.. |
Forum: C 3 Days Ago |
| Replies: 4 Views: 197 I would use fwrite
fwrite(&part1, sizeof(struct parts), 1, fd);
Where fd = FILE *stream |
Forum: C 5 Days Ago |
| Replies: 4 Views: 196 Note...I tried the above code with a client program I have here and it worked...Meaning it send the data and the client received it... |
Forum: C 5 Days Ago |
| Replies: 4 Views: 196 I quickly tried this an it doesn't fail...Note I never worked with AF_INET6...Also i took the liberty of changing some of your constants..
#include <stdio.h>
#include <stdlib.h>
#include... |
Forum: C 5 Days Ago |
| Replies: 4 Views: 196 Try:
connectSocket= accept(listenSocket, NULL, NULL);
Also I would check if an error returned on the two lines
bind(listenSocket,(struct sockaddr*)&serverAddress,sizeof(serverAddress)); |
Forum: C 6 Days Ago |
| Replies: 2 Views: 237 Try investigating order of operations |
Forum: C 7 Days Ago |
| Replies: 4 Views: 308 Not really sure what your question is...well beside the main homework question.. |
Forum: C 7 Days Ago |
| Replies: 1 Views: 311 Dynamic array yes..Look up VLA - variable length arrays |
Forum: C 9 Days Ago |
| Replies: 14 Views: 539 I'm not really sure what your after...but you could try working with a marco..
Note - Marcos are processed by the preprocessor as well |
Forum: C 9 Days Ago |
| Replies: 14 Views: 539 The include statement is processed by the preprocessor so it can't be dynamically created in the executable...
If you want to do this try Dlls |
Forum: C 9 Days Ago |
| Replies: 12 Views: 501 |
Forum: C 10 Days Ago |
| Replies: 4 Views: 310 Did you even look at what I posted? |
Forum: C 11 Days Ago |
| Replies: 9 Views: 312 He wanted to know why and that's probably why. One compiler set up the assembled code to read the values left to right and one set up the values to be read right to left. Like you said the language... |
Forum: C 11 Days Ago |
| Replies: 9 Views: 312 Because you don't set i back to 5
c=i++ + ++i + i++ + --i;
i = 5;////set i back to five
printf("\n%d",i++ + ++i + i++ + --i);
printf("\n%d",c); |
Forum: C 11 Days Ago |
| Replies: 9 Views: 312 It probably depends on how the compiler evaluates the expressions...left to right
or right to left... |
Forum: C 11 Days Ago |
| Replies: 4 Views: 310 check out what I did here, I put three fprintf lines in here to check the values you are entering in your char**...Also this program had many errors...It won't compile for me so I changed some of it... |
Forum: C 11 Days Ago |
| Replies: 2 Views: 215 fopen is defined as
FILE* fopen(const char *path, const char *mode);
and you have fopen (out, "w"); where out is FILE*. |
Forum: Getting Started and Choosing a Distro 12 Days Ago |
| Replies: 9 Views: 722 No KDE is O.K. just different...I run KDE on my Slackware box |
Forum: C 12 Days Ago |
| Replies: 4 Views: 260 I'm not sure which compiler your using but you should engage your warnings...i.e. gcc has a switch setting -Wall which is "warn all" and it picked up this problem in the compile stage.. |
Forum: C 12 Days Ago |
| Replies: 4 Views: 260 This function returns the address of the local variable str
char * leer()
{
char str[LONG], *p;
int c;
p = str;
while((c = getchar()) != EOF) |
Forum: C 13 Days Ago |
| Replies: 5 Views: 286 Or this one which is a little more exotic - the language lawyers should love this one
#include <stdio.h>
#include <stdlib.h>
void Test(char **cptr);
int main()
{ |
Forum: C 13 Days Ago |
| Replies: 5 Views: 286 I have this much modified example that you could use for an example:
#include <stdio.h>
#include <stdlib.h>
char* Test();
int main()
{ |
Forum: Assembly 13 Days Ago |
| Replies: 2 Views: 348 I would investigate the compare opcode and jump equal, jump not equal opcodes
Try this link:
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html
manual 3... |
Forum: C 13 Days Ago |
| Replies: 5 Views: 286 Right away I see some problems
void Test(char, int);
void Test(char *text, int *sizeptr) |
Forum: C 13 Days Ago |
| Replies: 2 Views: 250 Try defining your string "instruction" like below...
Also if you have errors in the future could you post them
/* Libraries */
#include <stdio.h>
#include <string.h>
char instruction[] =... |
Forum: C 13 Days Ago |
| Replies: 1 Views: 200 Try this link...it has it all broken down
http://makepp.sourceforge.net/1.19/makepp_tutorial.html |
Forum: C 14 Days Ago |
| Replies: 3 Views: 309 Here's a simple one:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char**argv)
{
fprintf(stdout, "ans->%u\n", 0xe5f6b7);
exit(EXIT_SUCCESS); |
Forum: C 14 Days Ago |
| Replies: 8 Views: 277 A very simple solution would be to read your character and then read the newline character into a dumby variable like
char ch, extrach;
fputs("enter a character->", stdout);
ch =... |
Forum: C 14 Days Ago |
| Replies: 8 Views: 277 Try looking at this simple version of what your doing
#include <stdio.h>
#include <stdlib.h>
int main()
{
char mych = 0;
fputs("enter a character->", stdout); |
Forum: C 14 Days Ago |
| Replies: 8 Views: 277 I added a fprintf function in your code...run and check the values of choice..
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void user()
{ |
Forum: C 14 Days Ago |
| Replies: 8 Views: 277 What is this program supposed to do? If you could give us an example...say
When I run this program and I'm prompted for this and I press this - this happens, when in fact this should happen...I... |