LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old
Rating: 2 votes, 5.00 average.

How to reverse a linked list? - C

Posted 02-01-2012 at 05:49 AM by Aquarius_Girl



Code:
void reverseLinkedList ()
{
	linkedList *pointer1;
	linkedList *pointer2;
	
	pointer1 = NULL;
	pointer2 = head->next;
	
	while (pointer2 != NULL)
	{
		head->next = pointer1;
		
		pointer1     = head;
		head         = pointer2;
		pointer2     = pointer2->next;
	}
...
Attached Files
File Type: txt reverseLinkedList.txt (1.8 KB, 5 views)
Senior Member
Posted in Data structures
Views 2673 Comments 0 Aquarius_Girl is offline
Old

Flattened rice AKA Poha (in Hindi)

Posted 01-25-2012 at 06:17 AM by Aquarius_Girl
Updated 07-04-2014 at 01:31 AM by Aquarius_Girl

Notice: Spoon measurement : 6mlIngredients:
  • 1 spoon small yellow Mustard seeds (Aka Sarson in Hindi)
  • 4 small Green chillies (Aka Hari mirch in Hindi) thinly chopped.
  • 1 and 1/2 spoon fresh Ginger (Aka Adrak in Hindi) finely grated.
  • 1/2 spoon Salt.
  • 2 medium Onions thinly chopped.
  • 1/4 spoon Turmeric powder (Aka Haldi in Hindi).
  • 4 cups Flattened rice.
  • Juice of half lemon.
  • Oil for frying.

Directions:
  • Wash the Flattened Rice. Keep it wide spread in a holed dish. Drain
...
Senior Member
Posted in Recipes
Views 14396 Comments 3 Aquarius_Girl is offline
Old

Setting watchpoint for watching writes on a variable in C++ - GDB

Posted 01-16-2012 at 06:14 AM by Aquarius_Girl
Updated 01-18-2012 at 09:48 AM by Aquarius_Girl

Watchpoint basics:
  • Watchpoints are set on the variables, not on the functions or on the lines of code.
  • When the watched variables are read or written, the watchpoint gets triggered and the program's execution stops.

Watchpoints on non-global variables:
  • To set a watchpoint on a non-global variable, we must first set a breakpoint that will stop the program in the scope of the variable to be watched.
  • The watchpoint can be set after the program stops at the above set breakpoint.
  • To
...
Senior Member
Posted in GNU GDB
Views 13117 Comments 0 Aquarius_Girl is offline
Old

How to pass command line arguments to main() through GDB? - C

Posted 01-10-2012 at 06:12 AM by Aquarius_Girl
Updated 02-03-2012 at 05:32 AM by Aquarius_Girl (Thanks to Mr.Code for pointing out the nonsense)

test.c
Code:
#include <stdio.h>
#include <string.h>

int main (int argc, char *argv[])
{
   if (argc >= 2)
   { 
      int i;
      for (i = 1; i < argc; i++)
         printf ("\nHaalloo! %s", argv[i]);
   }
   else
      printf ("\nForgot to key in something?");

   return 0;
}
Passing command line arguments to main() through...
Senior Member
Posted in GNU GDB
Views 18581 Comments 3 Aquarius_Girl is offline
Old

Writing a basic makefile

Posted 12-29-2011 at 03:54 AM by Aquarius_Girl
Updated 06-14-2012 at 03:44 AM by Aquarius_Girl

  • Q: Why should we split our program instead of
    placing all the code in one file?

    A: If/When our program becomes very large, or it contains
    the code for some entirely different sets of functionalities,
    it may become cumbersome for us to edit/read the lengthy
    code.
    Also, if we make a small change and then try to recompile,
    the whole giant file will get compiled again and may
    consume quite some amount of time.

    Dividing our
...
Senior Member
Posted in GNU Make
Views 1165 Comments 0 Aquarius_Girl is offline

  



All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration